
obj/user/faultalloc.debug:     file format elf32-i386


Disassembly of section .text:

00800020 <_start>:
// starts us running when we are initially loaded into a new environment.
.text
.globl _start
_start:
	// See if we were started with arguments on the stack
	cmpl $USTACKTOP, %esp
  800020:	81 fc 00 e0 bf ee    	cmp    $0xeebfe000,%esp
	jne args_exist
  800026:	75 04                	jne    80002c <args_exist>

	// If not, push dummy argc/argv arguments.
	// This happens when we are loaded by the kernel,
	// because the kernel does not know about passing arguments.
	pushl $0
  800028:	6a 00                	push   $0x0
	pushl $0
  80002a:	6a 00                	push   $0x0

0080002c <args_exist>:

args_exist:
	call libmain
  80002c:	e8 a1 00 00 00       	call   8000d2 <libmain>
1:	jmp 1b
  800031:	eb fe                	jmp    800031 <args_exist+0x5>

00800033 <handler>:

#include <inc/lib.h>

void
handler(struct UTrapframe *utf)
{
  800033:	f3 0f 1e fb          	endbr32 
  800037:	55                   	push   %ebp
  800038:	89 e5                	mov    %esp,%ebp
  80003a:	53                   	push   %ebx
  80003b:	83 ec 0c             	sub    $0xc,%esp
	int r;
	void *addr = (void*)utf->utf_fault_va;
  80003e:	8b 45 08             	mov    0x8(%ebp),%eax
  800041:	8b 18                	mov    (%eax),%ebx

	cprintf("fault %x\n", addr);
  800043:	53                   	push   %ebx
  800044:	68 00 20 80 00       	push   $0x802000
  800049:	e8 dd 01 00 00       	call   80022b <cprintf>
	if ((r = sys_page_alloc(0, ROUNDDOWN(addr, PGSIZE),
  80004e:	83 c4 0c             	add    $0xc,%esp
  800051:	6a 07                	push   $0x7
  800053:	89 d8                	mov    %ebx,%eax
  800055:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  80005a:	50                   	push   %eax
  80005b:	6a 00                	push   $0x0
  80005d:	e8 e4 0b 00 00       	call   800c46 <sys_page_alloc>
  800062:	83 c4 10             	add    $0x10,%esp
  800065:	85 c0                	test   %eax,%eax
  800067:	78 16                	js     80007f <handler+0x4c>
				PTE_P|PTE_U|PTE_W)) < 0)
		panic("allocating at %x in page fault handler: %e", addr, r);
	snprintf((char*) addr, 100, "this string was faulted in at %x", addr);
  800069:	53                   	push   %ebx
  80006a:	68 4c 20 80 00       	push   $0x80204c
  80006f:	6a 64                	push   $0x64
  800071:	53                   	push   %ebx
  800072:	e8 2c 07 00 00       	call   8007a3 <snprintf>
}
  800077:	83 c4 10             	add    $0x10,%esp
  80007a:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80007d:	c9                   	leave  
  80007e:	c3                   	ret    
		panic("allocating at %x in page fault handler: %e", addr, r);
  80007f:	83 ec 0c             	sub    $0xc,%esp
  800082:	50                   	push   %eax
  800083:	53                   	push   %ebx
  800084:	68 20 20 80 00       	push   $0x802020
  800089:	6a 0e                	push   $0xe
  80008b:	68 0a 20 80 00       	push   $0x80200a
  800090:	e8 af 00 00 00       	call   800144 <_panic>

00800095 <umain>:

void
umain(int argc, char **argv)
{
  800095:	f3 0f 1e fb          	endbr32 
  800099:	55                   	push   %ebp
  80009a:	89 e5                	mov    %esp,%ebp
  80009c:	83 ec 14             	sub    $0x14,%esp
	set_pgfault_handler(handler);
  80009f:	68 33 00 80 00       	push   $0x800033
  8000a4:	e8 ae 0d 00 00       	call   800e57 <set_pgfault_handler>
	cprintf("%s\n", (char*)0xDeadBeef);
  8000a9:	83 c4 08             	add    $0x8,%esp
  8000ac:	68 ef be ad de       	push   $0xdeadbeef
  8000b1:	68 1c 20 80 00       	push   $0x80201c
  8000b6:	e8 70 01 00 00       	call   80022b <cprintf>
	cprintf("%s\n", (char*)0xCafeBffe);
  8000bb:	83 c4 08             	add    $0x8,%esp
  8000be:	68 fe bf fe ca       	push   $0xcafebffe
  8000c3:	68 1c 20 80 00       	push   $0x80201c
  8000c8:	e8 5e 01 00 00       	call   80022b <cprintf>
}
  8000cd:	83 c4 10             	add    $0x10,%esp
  8000d0:	c9                   	leave  
  8000d1:	c3                   	ret    

008000d2 <libmain>:
const volatile struct Env *thisenv;
const char *binaryname = "<unknown>";

void
libmain(int argc, char **argv)
{
  8000d2:	f3 0f 1e fb          	endbr32 
  8000d6:	55                   	push   %ebp
  8000d7:	89 e5                	mov    %esp,%ebp
  8000d9:	56                   	push   %esi
  8000da:	53                   	push   %ebx
  8000db:	8b 5d 08             	mov    0x8(%ebp),%ebx
  8000de:	8b 75 0c             	mov    0xc(%ebp),%esi
	;    //系统调用，我们已经在Exercise 7中实现了
	
	
	
	//屏幕上打印出来了字母，但后续报错了，有意思，让我看看问题出现在哪。
	thisenv=0;
  8000e1:	c7 05 04 40 80 00 00 	movl   $0x0,0x804004
  8000e8:	00 00 00 
	thisenv = &envs[ENVX(sys_getenvid())];      //获取Env结构指针
  8000eb:	e8 10 0b 00 00       	call   800c00 <sys_getenvid>
  8000f0:	25 ff 03 00 00       	and    $0x3ff,%eax
  8000f5:	6b c0 7c             	imul   $0x7c,%eax,%eax
  8000f8:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  8000fd:	a3 04 40 80 00       	mov    %eax,0x804004

	// save the name of the program so that panic() can use it
	if (argc > 0)
  800102:	85 db                	test   %ebx,%ebx
  800104:	7e 07                	jle    80010d <libmain+0x3b>
		binaryname = argv[0];
  800106:	8b 06                	mov    (%esi),%eax
  800108:	a3 00 30 80 00       	mov    %eax,0x803000

	// call user main routine
	umain(argc, argv);
  80010d:	83 ec 08             	sub    $0x8,%esp
  800110:	56                   	push   %esi
  800111:	53                   	push   %ebx
  800112:	e8 7e ff ff ff       	call   800095 <umain>

	// exit gracefully
	exit();
  800117:	e8 0a 00 00 00       	call   800126 <exit>
}
  80011c:	83 c4 10             	add    $0x10,%esp
  80011f:	8d 65 f8             	lea    -0x8(%ebp),%esp
  800122:	5b                   	pop    %ebx
  800123:	5e                   	pop    %esi
  800124:	5d                   	pop    %ebp
  800125:	c3                   	ret    

00800126 <exit>:

#include <inc/lib.h>

void
exit(void)
{
  800126:	f3 0f 1e fb          	endbr32 
  80012a:	55                   	push   %ebp
  80012b:	89 e5                	mov    %esp,%ebp
  80012d:	83 ec 08             	sub    $0x8,%esp
	close_all();
  800130:	e8 b2 0f 00 00       	call   8010e7 <close_all>
	sys_env_destroy(0);
  800135:	83 ec 0c             	sub    $0xc,%esp
  800138:	6a 00                	push   $0x0
  80013a:	e8 7c 0a 00 00       	call   800bbb <sys_env_destroy>
}
  80013f:	83 c4 10             	add    $0x10,%esp
  800142:	c9                   	leave  
  800143:	c3                   	ret    

00800144 <_panic>:
 * It prints "panic: <message>", then causes a breakpoint exception,
 * which causes JOS to enter the JOS kernel monitor.
 */
void
_panic(const char *file, int line, const char *fmt, ...)
{
  800144:	f3 0f 1e fb          	endbr32 
  800148:	55                   	push   %ebp
  800149:	89 e5                	mov    %esp,%ebp
  80014b:	56                   	push   %esi
  80014c:	53                   	push   %ebx
	va_list ap;

	va_start(ap, fmt);
  80014d:	8d 5d 14             	lea    0x14(%ebp),%ebx

	// Print the panic message
	cprintf("[%08x] user panic in %s at %s:%d: ",
  800150:	8b 35 00 30 80 00    	mov    0x803000,%esi
  800156:	e8 a5 0a 00 00       	call   800c00 <sys_getenvid>
  80015b:	83 ec 0c             	sub    $0xc,%esp
  80015e:	ff 75 0c             	pushl  0xc(%ebp)
  800161:	ff 75 08             	pushl  0x8(%ebp)
  800164:	56                   	push   %esi
  800165:	50                   	push   %eax
  800166:	68 78 20 80 00       	push   $0x802078
  80016b:	e8 bb 00 00 00       	call   80022b <cprintf>
		sys_getenvid(), binaryname, file, line);
	vcprintf(fmt, ap);
  800170:	83 c4 18             	add    $0x18,%esp
  800173:	53                   	push   %ebx
  800174:	ff 75 10             	pushl  0x10(%ebp)
  800177:	e8 5a 00 00 00       	call   8001d6 <vcprintf>
	cprintf("\n");
  80017c:	c7 04 24 13 25 80 00 	movl   $0x802513,(%esp)
  800183:	e8 a3 00 00 00       	call   80022b <cprintf>
  800188:	83 c4 10             	add    $0x10,%esp

	// Cause a breakpoint exception
	while (1)
		asm volatile("int3");
  80018b:	cc                   	int3   
  80018c:	eb fd                	jmp    80018b <_panic+0x47>

0080018e <putch>:
};


static void
putch(int ch, struct printbuf *b)
{
  80018e:	f3 0f 1e fb          	endbr32 
  800192:	55                   	push   %ebp
  800193:	89 e5                	mov    %esp,%ebp
  800195:	53                   	push   %ebx
  800196:	83 ec 04             	sub    $0x4,%esp
  800199:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	b->buf[b->idx++] = ch;
  80019c:	8b 13                	mov    (%ebx),%edx
  80019e:	8d 42 01             	lea    0x1(%edx),%eax
  8001a1:	89 03                	mov    %eax,(%ebx)
  8001a3:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8001a6:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
	if (b->idx == 256-1) {
  8001aa:	3d ff 00 00 00       	cmp    $0xff,%eax
  8001af:	74 09                	je     8001ba <putch+0x2c>
		sys_cputs(b->buf, b->idx);
		b->idx = 0;
	}
	b->cnt++;
  8001b1:	83 43 04 01          	addl   $0x1,0x4(%ebx)
}
  8001b5:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8001b8:	c9                   	leave  
  8001b9:	c3                   	ret    
		sys_cputs(b->buf, b->idx);
  8001ba:	83 ec 08             	sub    $0x8,%esp
  8001bd:	68 ff 00 00 00       	push   $0xff
  8001c2:	8d 43 08             	lea    0x8(%ebx),%eax
  8001c5:	50                   	push   %eax
  8001c6:	e8 ab 09 00 00       	call   800b76 <sys_cputs>
		b->idx = 0;
  8001cb:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  8001d1:	83 c4 10             	add    $0x10,%esp
  8001d4:	eb db                	jmp    8001b1 <putch+0x23>

008001d6 <vcprintf>:

int
vcprintf(const char *fmt, va_list ap)
{
  8001d6:	f3 0f 1e fb          	endbr32 
  8001da:	55                   	push   %ebp
  8001db:	89 e5                	mov    %esp,%ebp
  8001dd:	81 ec 18 01 00 00    	sub    $0x118,%esp
	struct printbuf b;

	b.idx = 0;
  8001e3:	c7 85 f0 fe ff ff 00 	movl   $0x0,-0x110(%ebp)
  8001ea:	00 00 00 
	b.cnt = 0;
  8001ed:	c7 85 f4 fe ff ff 00 	movl   $0x0,-0x10c(%ebp)
  8001f4:	00 00 00 
	vprintfmt((void*)putch, &b, fmt, ap);
  8001f7:	ff 75 0c             	pushl  0xc(%ebp)
  8001fa:	ff 75 08             	pushl  0x8(%ebp)
  8001fd:	8d 85 f0 fe ff ff    	lea    -0x110(%ebp),%eax
  800203:	50                   	push   %eax
  800204:	68 8e 01 80 00       	push   $0x80018e
  800209:	e8 20 01 00 00       	call   80032e <vprintfmt>
	sys_cputs(b.buf, b.idx);
  80020e:	83 c4 08             	add    $0x8,%esp
  800211:	ff b5 f0 fe ff ff    	pushl  -0x110(%ebp)
  800217:	8d 85 f8 fe ff ff    	lea    -0x108(%ebp),%eax
  80021d:	50                   	push   %eax
  80021e:	e8 53 09 00 00       	call   800b76 <sys_cputs>

	return b.cnt;
}
  800223:	8b 85 f4 fe ff ff    	mov    -0x10c(%ebp),%eax
  800229:	c9                   	leave  
  80022a:	c3                   	ret    

0080022b <cprintf>:

int
cprintf(const char *fmt, ...)
{
  80022b:	f3 0f 1e fb          	endbr32 
  80022f:	55                   	push   %ebp
  800230:	89 e5                	mov    %esp,%ebp
  800232:	83 ec 10             	sub    $0x10,%esp
	va_list ap;
	int cnt;

	va_start(ap, fmt);
  800235:	8d 45 0c             	lea    0xc(%ebp),%eax
	cnt = vcprintf(fmt, ap);
  800238:	50                   	push   %eax
  800239:	ff 75 08             	pushl  0x8(%ebp)
  80023c:	e8 95 ff ff ff       	call   8001d6 <vcprintf>
	va_end(ap);

	return cnt;
}
  800241:	c9                   	leave  
  800242:	c3                   	ret    

00800243 <printnum>:
 * using specified putch function and associated pointer putdat.
 */
static void
printnum(void (*putch)(int, void*), void *putdat,
	 unsigned long long num, unsigned base, int width, int padc)
{
  800243:	55                   	push   %ebp
  800244:	89 e5                	mov    %esp,%ebp
  800246:	57                   	push   %edi
  800247:	56                   	push   %esi
  800248:	53                   	push   %ebx
  800249:	83 ec 1c             	sub    $0x1c,%esp
  80024c:	89 c7                	mov    %eax,%edi
  80024e:	89 d6                	mov    %edx,%esi
  800250:	8b 45 08             	mov    0x8(%ebp),%eax
  800253:	8b 55 0c             	mov    0xc(%ebp),%edx
  800256:	89 d1                	mov    %edx,%ecx
  800258:	89 c2                	mov    %eax,%edx
  80025a:	89 45 d8             	mov    %eax,-0x28(%ebp)
  80025d:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  800260:	8b 45 10             	mov    0x10(%ebp),%eax
  800263:	8b 5d 14             	mov    0x14(%ebp),%ebx
	// first recursively print all preceding (more significant) digits
	if (num >= base) {
  800266:	89 45 e0             	mov    %eax,-0x20(%ebp)
  800269:	c7 45 e4 00 00 00 00 	movl   $0x0,-0x1c(%ebp)
  800270:	39 c2                	cmp    %eax,%edx
  800272:	1b 4d e4             	sbb    -0x1c(%ebp),%ecx
  800275:	72 3e                	jb     8002b5 <printnum+0x72>
		printnum(putch, putdat, num / base, base, width - 1, padc);
  800277:	83 ec 0c             	sub    $0xc,%esp
  80027a:	ff 75 18             	pushl  0x18(%ebp)
  80027d:	83 eb 01             	sub    $0x1,%ebx
  800280:	53                   	push   %ebx
  800281:	50                   	push   %eax
  800282:	83 ec 08             	sub    $0x8,%esp
  800285:	ff 75 e4             	pushl  -0x1c(%ebp)
  800288:	ff 75 e0             	pushl  -0x20(%ebp)
  80028b:	ff 75 dc             	pushl  -0x24(%ebp)
  80028e:	ff 75 d8             	pushl  -0x28(%ebp)
  800291:	e8 0a 1b 00 00       	call   801da0 <__udivdi3>
  800296:	83 c4 18             	add    $0x18,%esp
  800299:	52                   	push   %edx
  80029a:	50                   	push   %eax
  80029b:	89 f2                	mov    %esi,%edx
  80029d:	89 f8                	mov    %edi,%eax
  80029f:	e8 9f ff ff ff       	call   800243 <printnum>
  8002a4:	83 c4 20             	add    $0x20,%esp
  8002a7:	eb 13                	jmp    8002bc <printnum+0x79>
	} else {
		// print any needed pad characters before first digit
		while (--width > 0)
			putch(padc, putdat);
  8002a9:	83 ec 08             	sub    $0x8,%esp
  8002ac:	56                   	push   %esi
  8002ad:	ff 75 18             	pushl  0x18(%ebp)
  8002b0:	ff d7                	call   *%edi
  8002b2:	83 c4 10             	add    $0x10,%esp
		while (--width > 0)
  8002b5:	83 eb 01             	sub    $0x1,%ebx
  8002b8:	85 db                	test   %ebx,%ebx
  8002ba:	7f ed                	jg     8002a9 <printnum+0x66>
	}

	// then print this (the least significant) digit
	putch("0123456789abcdef"[num % base], putdat);
  8002bc:	83 ec 08             	sub    $0x8,%esp
  8002bf:	56                   	push   %esi
  8002c0:	83 ec 04             	sub    $0x4,%esp
  8002c3:	ff 75 e4             	pushl  -0x1c(%ebp)
  8002c6:	ff 75 e0             	pushl  -0x20(%ebp)
  8002c9:	ff 75 dc             	pushl  -0x24(%ebp)
  8002cc:	ff 75 d8             	pushl  -0x28(%ebp)
  8002cf:	e8 dc 1b 00 00       	call   801eb0 <__umoddi3>
  8002d4:	83 c4 14             	add    $0x14,%esp
  8002d7:	0f be 80 9b 20 80 00 	movsbl 0x80209b(%eax),%eax
  8002de:	50                   	push   %eax
  8002df:	ff d7                	call   *%edi
}
  8002e1:	83 c4 10             	add    $0x10,%esp
  8002e4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8002e7:	5b                   	pop    %ebx
  8002e8:	5e                   	pop    %esi
  8002e9:	5f                   	pop    %edi
  8002ea:	5d                   	pop    %ebp
  8002eb:	c3                   	ret    

008002ec <sprintputch>:
	int cnt;
};

static void
sprintputch(int ch, struct sprintbuf *b)
{
  8002ec:	f3 0f 1e fb          	endbr32 
  8002f0:	55                   	push   %ebp
  8002f1:	89 e5                	mov    %esp,%ebp
  8002f3:	8b 45 0c             	mov    0xc(%ebp),%eax
	b->cnt++;
  8002f6:	83 40 08 01          	addl   $0x1,0x8(%eax)
	if (b->buf < b->ebuf)
  8002fa:	8b 10                	mov    (%eax),%edx
  8002fc:	3b 50 04             	cmp    0x4(%eax),%edx
  8002ff:	73 0a                	jae    80030b <sprintputch+0x1f>
		*b->buf++ = ch;
  800301:	8d 4a 01             	lea    0x1(%edx),%ecx
  800304:	89 08                	mov    %ecx,(%eax)
  800306:	8b 45 08             	mov    0x8(%ebp),%eax
  800309:	88 02                	mov    %al,(%edx)
}
  80030b:	5d                   	pop    %ebp
  80030c:	c3                   	ret    

0080030d <printfmt>:
{
  80030d:	f3 0f 1e fb          	endbr32 
  800311:	55                   	push   %ebp
  800312:	89 e5                	mov    %esp,%ebp
  800314:	83 ec 08             	sub    $0x8,%esp
	va_start(ap, fmt);
  800317:	8d 45 14             	lea    0x14(%ebp),%eax
	vprintfmt(putch, putdat, fmt, ap);
  80031a:	50                   	push   %eax
  80031b:	ff 75 10             	pushl  0x10(%ebp)
  80031e:	ff 75 0c             	pushl  0xc(%ebp)
  800321:	ff 75 08             	pushl  0x8(%ebp)
  800324:	e8 05 00 00 00       	call   80032e <vprintfmt>
}
  800329:	83 c4 10             	add    $0x10,%esp
  80032c:	c9                   	leave  
  80032d:	c3                   	ret    

0080032e <vprintfmt>:
{
  80032e:	f3 0f 1e fb          	endbr32 
  800332:	55                   	push   %ebp
  800333:	89 e5                	mov    %esp,%ebp
  800335:	57                   	push   %edi
  800336:	56                   	push   %esi
  800337:	53                   	push   %ebx
  800338:	83 ec 3c             	sub    $0x3c,%esp
  80033b:	8b 75 08             	mov    0x8(%ebp),%esi
  80033e:	8b 5d 0c             	mov    0xc(%ebp),%ebx
  800341:	8b 7d 10             	mov    0x10(%ebp),%edi
  800344:	e9 5d 03 00 00       	jmp    8006a6 <vprintfmt+0x378>
		padc = ' ';
  800349:	c6 45 d3 20          	movb   $0x20,-0x2d(%ebp)
		altflag = 0;
  80034d:	c7 45 e0 00 00 00 00 	movl   $0x0,-0x20(%ebp)
		precision = -1;
  800354:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
		width = -1;
  80035b:	c7 45 d4 ff ff ff ff 	movl   $0xffffffff,-0x2c(%ebp)
		lflag = 0;
  800362:	b9 00 00 00 00       	mov    $0x0,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800367:	8d 47 01             	lea    0x1(%edi),%eax
  80036a:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  80036d:	0f b6 17             	movzbl (%edi),%edx
  800370:	8d 42 dd             	lea    -0x23(%edx),%eax
  800373:	3c 55                	cmp    $0x55,%al
  800375:	0f 87 ae 03 00 00    	ja     800729 <vprintfmt+0x3fb>
  80037b:	0f b6 c0             	movzbl %al,%eax
  80037e:	3e ff 24 85 e0 21 80 	notrack jmp *0x8021e0(,%eax,4)
  800385:	00 
  800386:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			padc = '-';
  800389:	c6 45 d3 2d          	movb   $0x2d,-0x2d(%ebp)
  80038d:	eb d8                	jmp    800367 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  80038f:	8b 7d e4             	mov    -0x1c(%ebp),%edi
  800392:	c6 45 d3 30          	movb   $0x30,-0x2d(%ebp)
  800396:	eb cf                	jmp    800367 <vprintfmt+0x39>
  800398:	0f b6 d2             	movzbl %dl,%edx
  80039b:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			for (precision = 0; ; ++fmt) {
  80039e:	b8 00 00 00 00       	mov    $0x0,%eax
  8003a3:	89 4d e4             	mov    %ecx,-0x1c(%ebp)
				precision = precision * 10 + ch - '0';
  8003a6:	8d 04 80             	lea    (%eax,%eax,4),%eax
  8003a9:	8d 44 42 d0          	lea    -0x30(%edx,%eax,2),%eax
				ch = *fmt;
  8003ad:	0f be 17             	movsbl (%edi),%edx
				if (ch < '0' || ch > '9')
  8003b0:	8d 4a d0             	lea    -0x30(%edx),%ecx
  8003b3:	83 f9 09             	cmp    $0x9,%ecx
  8003b6:	77 55                	ja     80040d <vprintfmt+0xdf>
			for (precision = 0; ; ++fmt) {
  8003b8:	83 c7 01             	add    $0x1,%edi
				precision = precision * 10 + ch - '0';
  8003bb:	eb e9                	jmp    8003a6 <vprintfmt+0x78>
			precision = va_arg(ap, int);
  8003bd:	8b 45 14             	mov    0x14(%ebp),%eax
  8003c0:	8b 00                	mov    (%eax),%eax
  8003c2:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8003c5:	8b 45 14             	mov    0x14(%ebp),%eax
  8003c8:	8d 40 04             	lea    0x4(%eax),%eax
  8003cb:	89 45 14             	mov    %eax,0x14(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8003ce:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			if (width < 0)
  8003d1:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8003d5:	79 90                	jns    800367 <vprintfmt+0x39>
				width = precision, precision = -1;
  8003d7:	8b 45 d8             	mov    -0x28(%ebp),%eax
  8003da:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8003dd:	c7 45 d8 ff ff ff ff 	movl   $0xffffffff,-0x28(%ebp)
  8003e4:	eb 81                	jmp    800367 <vprintfmt+0x39>
  8003e6:	8b 45 d4             	mov    -0x2c(%ebp),%eax
  8003e9:	85 c0                	test   %eax,%eax
  8003eb:	ba 00 00 00 00       	mov    $0x0,%edx
  8003f0:	0f 49 d0             	cmovns %eax,%edx
  8003f3:	89 55 d4             	mov    %edx,-0x2c(%ebp)
		switch (ch = *(unsigned char *) fmt++) {
  8003f6:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  8003f9:	e9 69 ff ff ff       	jmp    800367 <vprintfmt+0x39>
		switch (ch = *(unsigned char *) fmt++) {
  8003fe:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			altflag = 1;
  800401:	c7 45 e0 01 00 00 00 	movl   $0x1,-0x20(%ebp)
			goto reswitch;
  800408:	e9 5a ff ff ff       	jmp    800367 <vprintfmt+0x39>
  80040d:	8b 4d e4             	mov    -0x1c(%ebp),%ecx
  800410:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800413:	eb bc                	jmp    8003d1 <vprintfmt+0xa3>
			lflag++;
  800415:	83 c1 01             	add    $0x1,%ecx
		switch (ch = *(unsigned char *) fmt++) {
  800418:	8b 7d e4             	mov    -0x1c(%ebp),%edi
			goto reswitch;
  80041b:	e9 47 ff ff ff       	jmp    800367 <vprintfmt+0x39>
			putch(va_arg(ap, int), putdat);
  800420:	8b 45 14             	mov    0x14(%ebp),%eax
  800423:	8d 78 04             	lea    0x4(%eax),%edi
  800426:	83 ec 08             	sub    $0x8,%esp
  800429:	53                   	push   %ebx
  80042a:	ff 30                	pushl  (%eax)
  80042c:	ff d6                	call   *%esi
			break;
  80042e:	83 c4 10             	add    $0x10,%esp
			putch(va_arg(ap, int), putdat);
  800431:	89 7d 14             	mov    %edi,0x14(%ebp)
			break;
  800434:	e9 6a 02 00 00       	jmp    8006a3 <vprintfmt+0x375>
			err = va_arg(ap, int);
  800439:	8b 45 14             	mov    0x14(%ebp),%eax
  80043c:	8d 78 04             	lea    0x4(%eax),%edi
  80043f:	8b 00                	mov    (%eax),%eax
  800441:	99                   	cltd   
  800442:	31 d0                	xor    %edx,%eax
  800444:	29 d0                	sub    %edx,%eax
			if (err >= MAXERROR || (p = error_string[err]) == NULL)
  800446:	83 f8 0f             	cmp    $0xf,%eax
  800449:	7f 23                	jg     80046e <vprintfmt+0x140>
  80044b:	8b 14 85 40 23 80 00 	mov    0x802340(,%eax,4),%edx
  800452:	85 d2                	test   %edx,%edx
  800454:	74 18                	je     80046e <vprintfmt+0x140>
				printfmt(putch, putdat, "%s", p);
  800456:	52                   	push   %edx
  800457:	68 e1 24 80 00       	push   $0x8024e1
  80045c:	53                   	push   %ebx
  80045d:	56                   	push   %esi
  80045e:	e8 aa fe ff ff       	call   80030d <printfmt>
  800463:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  800466:	89 7d 14             	mov    %edi,0x14(%ebp)
  800469:	e9 35 02 00 00       	jmp    8006a3 <vprintfmt+0x375>
				printfmt(putch, putdat, "error %d", err);
  80046e:	50                   	push   %eax
  80046f:	68 b3 20 80 00       	push   $0x8020b3
  800474:	53                   	push   %ebx
  800475:	56                   	push   %esi
  800476:	e8 92 fe ff ff       	call   80030d <printfmt>
  80047b:	83 c4 10             	add    $0x10,%esp
			err = va_arg(ap, int);
  80047e:	89 7d 14             	mov    %edi,0x14(%ebp)
				printfmt(putch, putdat, "error %d", err);
  800481:	e9 1d 02 00 00       	jmp    8006a3 <vprintfmt+0x375>
			if ((p = va_arg(ap, char *)) == NULL)
  800486:	8b 45 14             	mov    0x14(%ebp),%eax
  800489:	83 c0 04             	add    $0x4,%eax
  80048c:	89 45 c8             	mov    %eax,-0x38(%ebp)
  80048f:	8b 45 14             	mov    0x14(%ebp),%eax
  800492:	8b 10                	mov    (%eax),%edx
				p = "(null)";
  800494:	85 d2                	test   %edx,%edx
  800496:	b8 ac 20 80 00       	mov    $0x8020ac,%eax
  80049b:	0f 45 c2             	cmovne %edx,%eax
  80049e:	89 45 cc             	mov    %eax,-0x34(%ebp)
			if (width > 0 && padc != '-')
  8004a1:	83 7d d4 00          	cmpl   $0x0,-0x2c(%ebp)
  8004a5:	7e 06                	jle    8004ad <vprintfmt+0x17f>
  8004a7:	80 7d d3 2d          	cmpb   $0x2d,-0x2d(%ebp)
  8004ab:	75 0d                	jne    8004ba <vprintfmt+0x18c>
				for (width -= strnlen(p, precision); width > 0; width--)
  8004ad:	8b 45 cc             	mov    -0x34(%ebp),%eax
  8004b0:	89 c7                	mov    %eax,%edi
  8004b2:	03 45 d4             	add    -0x2c(%ebp),%eax
  8004b5:	89 45 d4             	mov    %eax,-0x2c(%ebp)
  8004b8:	eb 55                	jmp    80050f <vprintfmt+0x1e1>
  8004ba:	83 ec 08             	sub    $0x8,%esp
  8004bd:	ff 75 d8             	pushl  -0x28(%ebp)
  8004c0:	ff 75 cc             	pushl  -0x34(%ebp)
  8004c3:	e8 15 03 00 00       	call   8007dd <strnlen>
  8004c8:	8b 55 d4             	mov    -0x2c(%ebp),%edx
  8004cb:	29 c2                	sub    %eax,%edx
  8004cd:	89 55 c4             	mov    %edx,-0x3c(%ebp)
  8004d0:	83 c4 10             	add    $0x10,%esp
  8004d3:	89 d7                	mov    %edx,%edi
					putch(padc, putdat);
  8004d5:	0f be 45 d3          	movsbl -0x2d(%ebp),%eax
  8004d9:	89 45 d4             	mov    %eax,-0x2c(%ebp)
				for (width -= strnlen(p, precision); width > 0; width--)
  8004dc:	85 ff                	test   %edi,%edi
  8004de:	7e 11                	jle    8004f1 <vprintfmt+0x1c3>
					putch(padc, putdat);
  8004e0:	83 ec 08             	sub    $0x8,%esp
  8004e3:	53                   	push   %ebx
  8004e4:	ff 75 d4             	pushl  -0x2c(%ebp)
  8004e7:	ff d6                	call   *%esi
				for (width -= strnlen(p, precision); width > 0; width--)
  8004e9:	83 ef 01             	sub    $0x1,%edi
  8004ec:	83 c4 10             	add    $0x10,%esp
  8004ef:	eb eb                	jmp    8004dc <vprintfmt+0x1ae>
  8004f1:	8b 55 c4             	mov    -0x3c(%ebp),%edx
  8004f4:	85 d2                	test   %edx,%edx
  8004f6:	b8 00 00 00 00       	mov    $0x0,%eax
  8004fb:	0f 49 c2             	cmovns %edx,%eax
  8004fe:	29 c2                	sub    %eax,%edx
  800500:	89 55 d4             	mov    %edx,-0x2c(%ebp)
  800503:	eb a8                	jmp    8004ad <vprintfmt+0x17f>
					putch(ch, putdat);
  800505:	83 ec 08             	sub    $0x8,%esp
  800508:	53                   	push   %ebx
  800509:	52                   	push   %edx
  80050a:	ff d6                	call   *%esi
  80050c:	83 c4 10             	add    $0x10,%esp
  80050f:	8b 4d d4             	mov    -0x2c(%ebp),%ecx
  800512:	29 f9                	sub    %edi,%ecx
			for (; (ch = *p++) != '\0' && (precision < 0 || --precision >= 0); width--)
  800514:	83 c7 01             	add    $0x1,%edi
  800517:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  80051b:	0f be d0             	movsbl %al,%edx
  80051e:	85 d2                	test   %edx,%edx
  800520:	74 4b                	je     80056d <vprintfmt+0x23f>
  800522:	83 7d d8 00          	cmpl   $0x0,-0x28(%ebp)
  800526:	78 06                	js     80052e <vprintfmt+0x200>
  800528:	83 6d d8 01          	subl   $0x1,-0x28(%ebp)
  80052c:	78 1e                	js     80054c <vprintfmt+0x21e>
				if (altflag && (ch < ' ' || ch > '~'))
  80052e:	83 7d e0 00          	cmpl   $0x0,-0x20(%ebp)
  800532:	74 d1                	je     800505 <vprintfmt+0x1d7>
  800534:	0f be c0             	movsbl %al,%eax
  800537:	83 e8 20             	sub    $0x20,%eax
  80053a:	83 f8 5e             	cmp    $0x5e,%eax
  80053d:	76 c6                	jbe    800505 <vprintfmt+0x1d7>
					putch('?', putdat);
  80053f:	83 ec 08             	sub    $0x8,%esp
  800542:	53                   	push   %ebx
  800543:	6a 3f                	push   $0x3f
  800545:	ff d6                	call   *%esi
  800547:	83 c4 10             	add    $0x10,%esp
  80054a:	eb c3                	jmp    80050f <vprintfmt+0x1e1>
  80054c:	89 cf                	mov    %ecx,%edi
  80054e:	eb 0e                	jmp    80055e <vprintfmt+0x230>
				putch(' ', putdat);
  800550:	83 ec 08             	sub    $0x8,%esp
  800553:	53                   	push   %ebx
  800554:	6a 20                	push   $0x20
  800556:	ff d6                	call   *%esi
			for (; width > 0; width--)
  800558:	83 ef 01             	sub    $0x1,%edi
  80055b:	83 c4 10             	add    $0x10,%esp
  80055e:	85 ff                	test   %edi,%edi
  800560:	7f ee                	jg     800550 <vprintfmt+0x222>
			if ((p = va_arg(ap, char *)) == NULL)
  800562:	8b 45 c8             	mov    -0x38(%ebp),%eax
  800565:	89 45 14             	mov    %eax,0x14(%ebp)
  800568:	e9 36 01 00 00       	jmp    8006a3 <vprintfmt+0x375>
  80056d:	89 cf                	mov    %ecx,%edi
  80056f:	eb ed                	jmp    80055e <vprintfmt+0x230>
	if (lflag >= 2)
  800571:	83 f9 01             	cmp    $0x1,%ecx
  800574:	7f 1f                	jg     800595 <vprintfmt+0x267>
	else if (lflag)
  800576:	85 c9                	test   %ecx,%ecx
  800578:	74 67                	je     8005e1 <vprintfmt+0x2b3>
		return va_arg(*ap, long);
  80057a:	8b 45 14             	mov    0x14(%ebp),%eax
  80057d:	8b 00                	mov    (%eax),%eax
  80057f:	89 45 d8             	mov    %eax,-0x28(%ebp)
  800582:	89 c1                	mov    %eax,%ecx
  800584:	c1 f9 1f             	sar    $0x1f,%ecx
  800587:	89 4d dc             	mov    %ecx,-0x24(%ebp)
  80058a:	8b 45 14             	mov    0x14(%ebp),%eax
  80058d:	8d 40 04             	lea    0x4(%eax),%eax
  800590:	89 45 14             	mov    %eax,0x14(%ebp)
  800593:	eb 17                	jmp    8005ac <vprintfmt+0x27e>
		return va_arg(*ap, long long);
  800595:	8b 45 14             	mov    0x14(%ebp),%eax
  800598:	8b 50 04             	mov    0x4(%eax),%edx
  80059b:	8b 00                	mov    (%eax),%eax
  80059d:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005a0:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8005a3:	8b 45 14             	mov    0x14(%ebp),%eax
  8005a6:	8d 40 08             	lea    0x8(%eax),%eax
  8005a9:	89 45 14             	mov    %eax,0x14(%ebp)
			if ((long long) num < 0) {
  8005ac:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8005af:	8b 4d dc             	mov    -0x24(%ebp),%ecx
			base = 10;
  8005b2:	b8 0a 00 00 00       	mov    $0xa,%eax
			if ((long long) num < 0) {
  8005b7:	85 c9                	test   %ecx,%ecx
  8005b9:	0f 89 ca 00 00 00    	jns    800689 <vprintfmt+0x35b>
				putch('-', putdat);
  8005bf:	83 ec 08             	sub    $0x8,%esp
  8005c2:	53                   	push   %ebx
  8005c3:	6a 2d                	push   $0x2d
  8005c5:	ff d6                	call   *%esi
				num = -(long long) num;
  8005c7:	8b 55 d8             	mov    -0x28(%ebp),%edx
  8005ca:	8b 4d dc             	mov    -0x24(%ebp),%ecx
  8005cd:	f7 da                	neg    %edx
  8005cf:	83 d1 00             	adc    $0x0,%ecx
  8005d2:	f7 d9                	neg    %ecx
  8005d4:	83 c4 10             	add    $0x10,%esp
			base = 10;
  8005d7:	b8 0a 00 00 00       	mov    $0xa,%eax
  8005dc:	e9 a8 00 00 00       	jmp    800689 <vprintfmt+0x35b>
		return va_arg(*ap, int);
  8005e1:	8b 45 14             	mov    0x14(%ebp),%eax
  8005e4:	8b 00                	mov    (%eax),%eax
  8005e6:	89 45 d8             	mov    %eax,-0x28(%ebp)
  8005e9:	99                   	cltd   
  8005ea:	89 55 dc             	mov    %edx,-0x24(%ebp)
  8005ed:	8b 45 14             	mov    0x14(%ebp),%eax
  8005f0:	8d 40 04             	lea    0x4(%eax),%eax
  8005f3:	89 45 14             	mov    %eax,0x14(%ebp)
  8005f6:	eb b4                	jmp    8005ac <vprintfmt+0x27e>
	if (lflag >= 2)
  8005f8:	83 f9 01             	cmp    $0x1,%ecx
  8005fb:	7f 1b                	jg     800618 <vprintfmt+0x2ea>
	else if (lflag)
  8005fd:	85 c9                	test   %ecx,%ecx
  8005ff:	74 2c                	je     80062d <vprintfmt+0x2ff>
		return va_arg(*ap, unsigned long);
  800601:	8b 45 14             	mov    0x14(%ebp),%eax
  800604:	8b 10                	mov    (%eax),%edx
  800606:	b9 00 00 00 00       	mov    $0x0,%ecx
  80060b:	8d 40 04             	lea    0x4(%eax),%eax
  80060e:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800611:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long);
  800616:	eb 71                	jmp    800689 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  800618:	8b 45 14             	mov    0x14(%ebp),%eax
  80061b:	8b 10                	mov    (%eax),%edx
  80061d:	8b 48 04             	mov    0x4(%eax),%ecx
  800620:	8d 40 08             	lea    0x8(%eax),%eax
  800623:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  800626:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned long long);
  80062b:	eb 5c                	jmp    800689 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  80062d:	8b 45 14             	mov    0x14(%ebp),%eax
  800630:	8b 10                	mov    (%eax),%edx
  800632:	b9 00 00 00 00       	mov    $0x0,%ecx
  800637:	8d 40 04             	lea    0x4(%eax),%eax
  80063a:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 10;
  80063d:	b8 0a 00 00 00       	mov    $0xa,%eax
		return va_arg(*ap, unsigned int);
  800642:	eb 45                	jmp    800689 <vprintfmt+0x35b>
			putch('X', putdat);
  800644:	83 ec 08             	sub    $0x8,%esp
  800647:	53                   	push   %ebx
  800648:	6a 58                	push   $0x58
  80064a:	ff d6                	call   *%esi
			putch('X', putdat);
  80064c:	83 c4 08             	add    $0x8,%esp
  80064f:	53                   	push   %ebx
  800650:	6a 58                	push   $0x58
  800652:	ff d6                	call   *%esi
			putch('X', putdat);
  800654:	83 c4 08             	add    $0x8,%esp
  800657:	53                   	push   %ebx
  800658:	6a 58                	push   $0x58
  80065a:	ff d6                	call   *%esi
			break;
  80065c:	83 c4 10             	add    $0x10,%esp
  80065f:	eb 42                	jmp    8006a3 <vprintfmt+0x375>
			putch('0', putdat);
  800661:	83 ec 08             	sub    $0x8,%esp
  800664:	53                   	push   %ebx
  800665:	6a 30                	push   $0x30
  800667:	ff d6                	call   *%esi
			putch('x', putdat);
  800669:	83 c4 08             	add    $0x8,%esp
  80066c:	53                   	push   %ebx
  80066d:	6a 78                	push   $0x78
  80066f:	ff d6                	call   *%esi
			num = (unsigned long long)
  800671:	8b 45 14             	mov    0x14(%ebp),%eax
  800674:	8b 10                	mov    (%eax),%edx
  800676:	b9 00 00 00 00       	mov    $0x0,%ecx
			goto number;
  80067b:	83 c4 10             	add    $0x10,%esp
				(uintptr_t) va_arg(ap, void *);
  80067e:	8d 40 04             	lea    0x4(%eax),%eax
  800681:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  800684:	b8 10 00 00 00       	mov    $0x10,%eax
			printnum(putch, putdat, num, base, width, padc);
  800689:	83 ec 0c             	sub    $0xc,%esp
  80068c:	0f be 7d d3          	movsbl -0x2d(%ebp),%edi
  800690:	57                   	push   %edi
  800691:	ff 75 d4             	pushl  -0x2c(%ebp)
  800694:	50                   	push   %eax
  800695:	51                   	push   %ecx
  800696:	52                   	push   %edx
  800697:	89 da                	mov    %ebx,%edx
  800699:	89 f0                	mov    %esi,%eax
  80069b:	e8 a3 fb ff ff       	call   800243 <printnum>
			break;
  8006a0:	83 c4 20             	add    $0x20,%esp
			if ((p = va_arg(ap, char *)) == NULL)
  8006a3:	8b 7d e4             	mov    -0x1c(%ebp),%edi
		while ((ch = *(unsigned char *) fmt++) != '%') {
  8006a6:	83 c7 01             	add    $0x1,%edi
  8006a9:	0f b6 47 ff          	movzbl -0x1(%edi),%eax
  8006ad:	83 f8 25             	cmp    $0x25,%eax
  8006b0:	0f 84 93 fc ff ff    	je     800349 <vprintfmt+0x1b>
			if (ch == '\0')
  8006b6:	85 c0                	test   %eax,%eax
  8006b8:	0f 84 8b 00 00 00    	je     800749 <vprintfmt+0x41b>
			putch(ch, putdat);
  8006be:	83 ec 08             	sub    $0x8,%esp
  8006c1:	53                   	push   %ebx
  8006c2:	50                   	push   %eax
  8006c3:	ff d6                	call   *%esi
  8006c5:	83 c4 10             	add    $0x10,%esp
  8006c8:	eb dc                	jmp    8006a6 <vprintfmt+0x378>
	if (lflag >= 2)
  8006ca:	83 f9 01             	cmp    $0x1,%ecx
  8006cd:	7f 1b                	jg     8006ea <vprintfmt+0x3bc>
	else if (lflag)
  8006cf:	85 c9                	test   %ecx,%ecx
  8006d1:	74 2c                	je     8006ff <vprintfmt+0x3d1>
		return va_arg(*ap, unsigned long);
  8006d3:	8b 45 14             	mov    0x14(%ebp),%eax
  8006d6:	8b 10                	mov    (%eax),%edx
  8006d8:	b9 00 00 00 00       	mov    $0x0,%ecx
  8006dd:	8d 40 04             	lea    0x4(%eax),%eax
  8006e0:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8006e3:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long);
  8006e8:	eb 9f                	jmp    800689 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned long long);
  8006ea:	8b 45 14             	mov    0x14(%ebp),%eax
  8006ed:	8b 10                	mov    (%eax),%edx
  8006ef:	8b 48 04             	mov    0x4(%eax),%ecx
  8006f2:	8d 40 08             	lea    0x8(%eax),%eax
  8006f5:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  8006f8:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned long long);
  8006fd:	eb 8a                	jmp    800689 <vprintfmt+0x35b>
		return va_arg(*ap, unsigned int);
  8006ff:	8b 45 14             	mov    0x14(%ebp),%eax
  800702:	8b 10                	mov    (%eax),%edx
  800704:	b9 00 00 00 00       	mov    $0x0,%ecx
  800709:	8d 40 04             	lea    0x4(%eax),%eax
  80070c:	89 45 14             	mov    %eax,0x14(%ebp)
			base = 16;
  80070f:	b8 10 00 00 00       	mov    $0x10,%eax
		return va_arg(*ap, unsigned int);
  800714:	e9 70 ff ff ff       	jmp    800689 <vprintfmt+0x35b>
			putch(ch, putdat);
  800719:	83 ec 08             	sub    $0x8,%esp
  80071c:	53                   	push   %ebx
  80071d:	6a 25                	push   $0x25
  80071f:	ff d6                	call   *%esi
			break;
  800721:	83 c4 10             	add    $0x10,%esp
  800724:	e9 7a ff ff ff       	jmp    8006a3 <vprintfmt+0x375>
			putch('%', putdat);
  800729:	83 ec 08             	sub    $0x8,%esp
  80072c:	53                   	push   %ebx
  80072d:	6a 25                	push   $0x25
  80072f:	ff d6                	call   *%esi
			for (fmt--; fmt[-1] != '%'; fmt--)
  800731:	83 c4 10             	add    $0x10,%esp
  800734:	89 f8                	mov    %edi,%eax
  800736:	80 78 ff 25          	cmpb   $0x25,-0x1(%eax)
  80073a:	74 05                	je     800741 <vprintfmt+0x413>
  80073c:	83 e8 01             	sub    $0x1,%eax
  80073f:	eb f5                	jmp    800736 <vprintfmt+0x408>
  800741:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  800744:	e9 5a ff ff ff       	jmp    8006a3 <vprintfmt+0x375>
}
  800749:	8d 65 f4             	lea    -0xc(%ebp),%esp
  80074c:	5b                   	pop    %ebx
  80074d:	5e                   	pop    %esi
  80074e:	5f                   	pop    %edi
  80074f:	5d                   	pop    %ebp
  800750:	c3                   	ret    

00800751 <vsnprintf>:

int
vsnprintf(char *buf, int n, const char *fmt, va_list ap)
{
  800751:	f3 0f 1e fb          	endbr32 
  800755:	55                   	push   %ebp
  800756:	89 e5                	mov    %esp,%ebp
  800758:	83 ec 18             	sub    $0x18,%esp
  80075b:	8b 45 08             	mov    0x8(%ebp),%eax
  80075e:	8b 55 0c             	mov    0xc(%ebp),%edx
	struct sprintbuf b = {buf, buf+n-1, 0};
  800761:	89 45 ec             	mov    %eax,-0x14(%ebp)
  800764:	8d 4c 10 ff          	lea    -0x1(%eax,%edx,1),%ecx
  800768:	89 4d f0             	mov    %ecx,-0x10(%ebp)
  80076b:	c7 45 f4 00 00 00 00 	movl   $0x0,-0xc(%ebp)

	if (buf == NULL || n < 1)
  800772:	85 c0                	test   %eax,%eax
  800774:	74 26                	je     80079c <vsnprintf+0x4b>
  800776:	85 d2                	test   %edx,%edx
  800778:	7e 22                	jle    80079c <vsnprintf+0x4b>
		return -E_INVAL;

	// print the string to the buffer
	vprintfmt((void*)sprintputch, &b, fmt, ap);
  80077a:	ff 75 14             	pushl  0x14(%ebp)
  80077d:	ff 75 10             	pushl  0x10(%ebp)
  800780:	8d 45 ec             	lea    -0x14(%ebp),%eax
  800783:	50                   	push   %eax
  800784:	68 ec 02 80 00       	push   $0x8002ec
  800789:	e8 a0 fb ff ff       	call   80032e <vprintfmt>

	// null terminate the buffer
	*b.buf = '\0';
  80078e:	8b 45 ec             	mov    -0x14(%ebp),%eax
  800791:	c6 00 00             	movb   $0x0,(%eax)

	return b.cnt;
  800794:	8b 45 f4             	mov    -0xc(%ebp),%eax
  800797:	83 c4 10             	add    $0x10,%esp
}
  80079a:	c9                   	leave  
  80079b:	c3                   	ret    
		return -E_INVAL;
  80079c:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  8007a1:	eb f7                	jmp    80079a <vsnprintf+0x49>

008007a3 <snprintf>:

int
snprintf(char *buf, int n, const char *fmt, ...)
{
  8007a3:	f3 0f 1e fb          	endbr32 
  8007a7:	55                   	push   %ebp
  8007a8:	89 e5                	mov    %esp,%ebp
  8007aa:	83 ec 08             	sub    $0x8,%esp
	va_list ap;
	int rc;

	va_start(ap, fmt);
  8007ad:	8d 45 14             	lea    0x14(%ebp),%eax
	rc = vsnprintf(buf, n, fmt, ap);
  8007b0:	50                   	push   %eax
  8007b1:	ff 75 10             	pushl  0x10(%ebp)
  8007b4:	ff 75 0c             	pushl  0xc(%ebp)
  8007b7:	ff 75 08             	pushl  0x8(%ebp)
  8007ba:	e8 92 ff ff ff       	call   800751 <vsnprintf>
	va_end(ap);

	return rc;
}
  8007bf:	c9                   	leave  
  8007c0:	c3                   	ret    

008007c1 <strlen>:
// Primespipe runs 3x faster this way.
#define ASM 1

int
strlen(const char *s)
{
  8007c1:	f3 0f 1e fb          	endbr32 
  8007c5:	55                   	push   %ebp
  8007c6:	89 e5                	mov    %esp,%ebp
  8007c8:	8b 55 08             	mov    0x8(%ebp),%edx
	int n;

	for (n = 0; *s != '\0'; s++)
  8007cb:	b8 00 00 00 00       	mov    $0x0,%eax
  8007d0:	80 3c 02 00          	cmpb   $0x0,(%edx,%eax,1)
  8007d4:	74 05                	je     8007db <strlen+0x1a>
		n++;
  8007d6:	83 c0 01             	add    $0x1,%eax
  8007d9:	eb f5                	jmp    8007d0 <strlen+0xf>
	return n;
}
  8007db:	5d                   	pop    %ebp
  8007dc:	c3                   	ret    

008007dd <strnlen>:

int
strnlen(const char *s, size_t size)
{
  8007dd:	f3 0f 1e fb          	endbr32 
  8007e1:	55                   	push   %ebp
  8007e2:	89 e5                	mov    %esp,%ebp
  8007e4:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8007e7:	8b 55 0c             	mov    0xc(%ebp),%edx
	int n;

	for (n = 0; size > 0 && *s != '\0'; s++, size--)
  8007ea:	b8 00 00 00 00       	mov    $0x0,%eax
  8007ef:	39 d0                	cmp    %edx,%eax
  8007f1:	74 0d                	je     800800 <strnlen+0x23>
  8007f3:	80 3c 01 00          	cmpb   $0x0,(%ecx,%eax,1)
  8007f7:	74 05                	je     8007fe <strnlen+0x21>
		n++;
  8007f9:	83 c0 01             	add    $0x1,%eax
  8007fc:	eb f1                	jmp    8007ef <strnlen+0x12>
  8007fe:	89 c2                	mov    %eax,%edx
	return n;
}
  800800:	89 d0                	mov    %edx,%eax
  800802:	5d                   	pop    %ebp
  800803:	c3                   	ret    

00800804 <strcpy>:

char *
strcpy(char *dst, const char *src)
{
  800804:	f3 0f 1e fb          	endbr32 
  800808:	55                   	push   %ebp
  800809:	89 e5                	mov    %esp,%ebp
  80080b:	53                   	push   %ebx
  80080c:	8b 4d 08             	mov    0x8(%ebp),%ecx
  80080f:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	char *ret;

	ret = dst;
	while ((*dst++ = *src++) != '\0')
  800812:	b8 00 00 00 00       	mov    $0x0,%eax
  800817:	0f b6 14 03          	movzbl (%ebx,%eax,1),%edx
  80081b:	88 14 01             	mov    %dl,(%ecx,%eax,1)
  80081e:	83 c0 01             	add    $0x1,%eax
  800821:	84 d2                	test   %dl,%dl
  800823:	75 f2                	jne    800817 <strcpy+0x13>
		/* do nothing */;
	return ret;
}
  800825:	89 c8                	mov    %ecx,%eax
  800827:	5b                   	pop    %ebx
  800828:	5d                   	pop    %ebp
  800829:	c3                   	ret    

0080082a <strcat>:

char *
strcat(char *dst, const char *src)
{
  80082a:	f3 0f 1e fb          	endbr32 
  80082e:	55                   	push   %ebp
  80082f:	89 e5                	mov    %esp,%ebp
  800831:	53                   	push   %ebx
  800832:	83 ec 10             	sub    $0x10,%esp
  800835:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int len = strlen(dst);
  800838:	53                   	push   %ebx
  800839:	e8 83 ff ff ff       	call   8007c1 <strlen>
  80083e:	83 c4 08             	add    $0x8,%esp
	strcpy(dst + len, src);
  800841:	ff 75 0c             	pushl  0xc(%ebp)
  800844:	01 d8                	add    %ebx,%eax
  800846:	50                   	push   %eax
  800847:	e8 b8 ff ff ff       	call   800804 <strcpy>
	return dst;
}
  80084c:	89 d8                	mov    %ebx,%eax
  80084e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  800851:	c9                   	leave  
  800852:	c3                   	ret    

00800853 <strncpy>:

char *
strncpy(char *dst, const char *src, size_t size) {
  800853:	f3 0f 1e fb          	endbr32 
  800857:	55                   	push   %ebp
  800858:	89 e5                	mov    %esp,%ebp
  80085a:	56                   	push   %esi
  80085b:	53                   	push   %ebx
  80085c:	8b 75 08             	mov    0x8(%ebp),%esi
  80085f:	8b 55 0c             	mov    0xc(%ebp),%edx
  800862:	89 f3                	mov    %esi,%ebx
  800864:	03 5d 10             	add    0x10(%ebp),%ebx
	size_t i;
	char *ret;

	ret = dst;
	for (i = 0; i < size; i++) {
  800867:	89 f0                	mov    %esi,%eax
  800869:	39 d8                	cmp    %ebx,%eax
  80086b:	74 11                	je     80087e <strncpy+0x2b>
		*dst++ = *src;
  80086d:	83 c0 01             	add    $0x1,%eax
  800870:	0f b6 0a             	movzbl (%edx),%ecx
  800873:	88 48 ff             	mov    %cl,-0x1(%eax)
		// If strlen(src) < size, null-pad 'dst' out to 'size' chars
		if (*src != '\0')
			src++;
  800876:	80 f9 01             	cmp    $0x1,%cl
  800879:	83 da ff             	sbb    $0xffffffff,%edx
  80087c:	eb eb                	jmp    800869 <strncpy+0x16>
	}
	return ret;
}
  80087e:	89 f0                	mov    %esi,%eax
  800880:	5b                   	pop    %ebx
  800881:	5e                   	pop    %esi
  800882:	5d                   	pop    %ebp
  800883:	c3                   	ret    

00800884 <strlcpy>:

size_t
strlcpy(char *dst, const char *src, size_t size)
{
  800884:	f3 0f 1e fb          	endbr32 
  800888:	55                   	push   %ebp
  800889:	89 e5                	mov    %esp,%ebp
  80088b:	56                   	push   %esi
  80088c:	53                   	push   %ebx
  80088d:	8b 75 08             	mov    0x8(%ebp),%esi
  800890:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800893:	8b 55 10             	mov    0x10(%ebp),%edx
  800896:	89 f0                	mov    %esi,%eax
	char *dst_in;

	dst_in = dst;
	if (size > 0) {
  800898:	85 d2                	test   %edx,%edx
  80089a:	74 21                	je     8008bd <strlcpy+0x39>
  80089c:	8d 44 16 ff          	lea    -0x1(%esi,%edx,1),%eax
  8008a0:	89 f2                	mov    %esi,%edx
		while (--size > 0 && *src != '\0')
  8008a2:	39 c2                	cmp    %eax,%edx
  8008a4:	74 14                	je     8008ba <strlcpy+0x36>
  8008a6:	0f b6 19             	movzbl (%ecx),%ebx
  8008a9:	84 db                	test   %bl,%bl
  8008ab:	74 0b                	je     8008b8 <strlcpy+0x34>
			*dst++ = *src++;
  8008ad:	83 c1 01             	add    $0x1,%ecx
  8008b0:	83 c2 01             	add    $0x1,%edx
  8008b3:	88 5a ff             	mov    %bl,-0x1(%edx)
  8008b6:	eb ea                	jmp    8008a2 <strlcpy+0x1e>
  8008b8:	89 d0                	mov    %edx,%eax
		*dst = '\0';
  8008ba:	c6 00 00             	movb   $0x0,(%eax)
	}
	return dst - dst_in;
  8008bd:	29 f0                	sub    %esi,%eax
}
  8008bf:	5b                   	pop    %ebx
  8008c0:	5e                   	pop    %esi
  8008c1:	5d                   	pop    %ebp
  8008c2:	c3                   	ret    

008008c3 <strcmp>:

int
strcmp(const char *p, const char *q)
{
  8008c3:	f3 0f 1e fb          	endbr32 
  8008c7:	55                   	push   %ebp
  8008c8:	89 e5                	mov    %esp,%ebp
  8008ca:	8b 4d 08             	mov    0x8(%ebp),%ecx
  8008cd:	8b 55 0c             	mov    0xc(%ebp),%edx
	while (*p && *p == *q)
  8008d0:	0f b6 01             	movzbl (%ecx),%eax
  8008d3:	84 c0                	test   %al,%al
  8008d5:	74 0c                	je     8008e3 <strcmp+0x20>
  8008d7:	3a 02                	cmp    (%edx),%al
  8008d9:	75 08                	jne    8008e3 <strcmp+0x20>
		p++, q++;
  8008db:	83 c1 01             	add    $0x1,%ecx
  8008de:	83 c2 01             	add    $0x1,%edx
  8008e1:	eb ed                	jmp    8008d0 <strcmp+0xd>
	return (int) ((unsigned char) *p - (unsigned char) *q);
  8008e3:	0f b6 c0             	movzbl %al,%eax
  8008e6:	0f b6 12             	movzbl (%edx),%edx
  8008e9:	29 d0                	sub    %edx,%eax
}
  8008eb:	5d                   	pop    %ebp
  8008ec:	c3                   	ret    

008008ed <strncmp>:

int
strncmp(const char *p, const char *q, size_t n)
{
  8008ed:	f3 0f 1e fb          	endbr32 
  8008f1:	55                   	push   %ebp
  8008f2:	89 e5                	mov    %esp,%ebp
  8008f4:	53                   	push   %ebx
  8008f5:	8b 45 08             	mov    0x8(%ebp),%eax
  8008f8:	8b 55 0c             	mov    0xc(%ebp),%edx
  8008fb:	89 c3                	mov    %eax,%ebx
  8008fd:	03 5d 10             	add    0x10(%ebp),%ebx
	while (n > 0 && *p && *p == *q)
  800900:	eb 06                	jmp    800908 <strncmp+0x1b>
		n--, p++, q++;
  800902:	83 c0 01             	add    $0x1,%eax
  800905:	83 c2 01             	add    $0x1,%edx
	while (n > 0 && *p && *p == *q)
  800908:	39 d8                	cmp    %ebx,%eax
  80090a:	74 16                	je     800922 <strncmp+0x35>
  80090c:	0f b6 08             	movzbl (%eax),%ecx
  80090f:	84 c9                	test   %cl,%cl
  800911:	74 04                	je     800917 <strncmp+0x2a>
  800913:	3a 0a                	cmp    (%edx),%cl
  800915:	74 eb                	je     800902 <strncmp+0x15>
	if (n == 0)
		return 0;
	else
		return (int) ((unsigned char) *p - (unsigned char) *q);
  800917:	0f b6 00             	movzbl (%eax),%eax
  80091a:	0f b6 12             	movzbl (%edx),%edx
  80091d:	29 d0                	sub    %edx,%eax
}
  80091f:	5b                   	pop    %ebx
  800920:	5d                   	pop    %ebp
  800921:	c3                   	ret    
		return 0;
  800922:	b8 00 00 00 00       	mov    $0x0,%eax
  800927:	eb f6                	jmp    80091f <strncmp+0x32>

00800929 <strchr>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a null pointer if the string has no 'c'.
char *
strchr(const char *s, char c)
{
  800929:	f3 0f 1e fb          	endbr32 
  80092d:	55                   	push   %ebp
  80092e:	89 e5                	mov    %esp,%ebp
  800930:	8b 45 08             	mov    0x8(%ebp),%eax
  800933:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  800937:	0f b6 10             	movzbl (%eax),%edx
  80093a:	84 d2                	test   %dl,%dl
  80093c:	74 09                	je     800947 <strchr+0x1e>
		if (*s == c)
  80093e:	38 ca                	cmp    %cl,%dl
  800940:	74 0a                	je     80094c <strchr+0x23>
	for (; *s; s++)
  800942:	83 c0 01             	add    $0x1,%eax
  800945:	eb f0                	jmp    800937 <strchr+0xe>
			return (char *) s;
	return 0;
  800947:	b8 00 00 00 00       	mov    $0x0,%eax
}
  80094c:	5d                   	pop    %ebp
  80094d:	c3                   	ret    

0080094e <strfind>:

// Return a pointer to the first occurrence of 'c' in 's',
// or a pointer to the string-ending null character if the string has no 'c'.
char *
strfind(const char *s, char c)
{
  80094e:	f3 0f 1e fb          	endbr32 
  800952:	55                   	push   %ebp
  800953:	89 e5                	mov    %esp,%ebp
  800955:	8b 45 08             	mov    0x8(%ebp),%eax
  800958:	0f b6 4d 0c          	movzbl 0xc(%ebp),%ecx
	for (; *s; s++)
  80095c:	0f b6 10             	movzbl (%eax),%edx
		if (*s == c)
  80095f:	38 ca                	cmp    %cl,%dl
  800961:	74 09                	je     80096c <strfind+0x1e>
  800963:	84 d2                	test   %dl,%dl
  800965:	74 05                	je     80096c <strfind+0x1e>
	for (; *s; s++)
  800967:	83 c0 01             	add    $0x1,%eax
  80096a:	eb f0                	jmp    80095c <strfind+0xe>
			break;
	return (char *) s;
}
  80096c:	5d                   	pop    %ebp
  80096d:	c3                   	ret    

0080096e <memset>:

#if ASM
void *
memset(void *v, int c, size_t n)
{
  80096e:	f3 0f 1e fb          	endbr32 
  800972:	55                   	push   %ebp
  800973:	89 e5                	mov    %esp,%ebp
  800975:	57                   	push   %edi
  800976:	56                   	push   %esi
  800977:	53                   	push   %ebx
  800978:	8b 7d 08             	mov    0x8(%ebp),%edi
  80097b:	8b 4d 10             	mov    0x10(%ebp),%ecx
	char *p;

	if (n == 0)
  80097e:	85 c9                	test   %ecx,%ecx
  800980:	74 31                	je     8009b3 <memset+0x45>
		return v;
	if ((int)v%4 == 0 && n%4 == 0) {
  800982:	89 f8                	mov    %edi,%eax
  800984:	09 c8                	or     %ecx,%eax
  800986:	a8 03                	test   $0x3,%al
  800988:	75 23                	jne    8009ad <memset+0x3f>
		c &= 0xFF;
  80098a:	0f b6 55 0c          	movzbl 0xc(%ebp),%edx
		c = (c<<24)|(c<<16)|(c<<8)|c;
  80098e:	89 d3                	mov    %edx,%ebx
  800990:	c1 e3 08             	shl    $0x8,%ebx
  800993:	89 d0                	mov    %edx,%eax
  800995:	c1 e0 18             	shl    $0x18,%eax
  800998:	89 d6                	mov    %edx,%esi
  80099a:	c1 e6 10             	shl    $0x10,%esi
  80099d:	09 f0                	or     %esi,%eax
  80099f:	09 c2                	or     %eax,%edx
  8009a1:	09 da                	or     %ebx,%edx
		asm volatile("cld; rep stosl\n"
			:: "D" (v), "a" (c), "c" (n/4)
  8009a3:	c1 e9 02             	shr    $0x2,%ecx
		asm volatile("cld; rep stosl\n"
  8009a6:	89 d0                	mov    %edx,%eax
  8009a8:	fc                   	cld    
  8009a9:	f3 ab                	rep stos %eax,%es:(%edi)
  8009ab:	eb 06                	jmp    8009b3 <memset+0x45>
			: "cc", "memory");
	} else
		asm volatile("cld; rep stosb\n"
  8009ad:	8b 45 0c             	mov    0xc(%ebp),%eax
  8009b0:	fc                   	cld    
  8009b1:	f3 aa                	rep stos %al,%es:(%edi)
			:: "D" (v), "a" (c), "c" (n)
			: "cc", "memory");
	return v;
}
  8009b3:	89 f8                	mov    %edi,%eax
  8009b5:	5b                   	pop    %ebx
  8009b6:	5e                   	pop    %esi
  8009b7:	5f                   	pop    %edi
  8009b8:	5d                   	pop    %ebp
  8009b9:	c3                   	ret    

008009ba <memmove>:

void *
memmove(void *dst, const void *src, size_t n)
{
  8009ba:	f3 0f 1e fb          	endbr32 
  8009be:	55                   	push   %ebp
  8009bf:	89 e5                	mov    %esp,%ebp
  8009c1:	57                   	push   %edi
  8009c2:	56                   	push   %esi
  8009c3:	8b 45 08             	mov    0x8(%ebp),%eax
  8009c6:	8b 75 0c             	mov    0xc(%ebp),%esi
  8009c9:	8b 4d 10             	mov    0x10(%ebp),%ecx
	const char *s;
	char *d;

	s = src;
	d = dst;
	if (s < d && s + n > d) {
  8009cc:	39 c6                	cmp    %eax,%esi
  8009ce:	73 32                	jae    800a02 <memmove+0x48>
  8009d0:	8d 14 0e             	lea    (%esi,%ecx,1),%edx
  8009d3:	39 c2                	cmp    %eax,%edx
  8009d5:	76 2b                	jbe    800a02 <memmove+0x48>
		s += n;
		d += n;
  8009d7:	8d 3c 08             	lea    (%eax,%ecx,1),%edi
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  8009da:	89 fe                	mov    %edi,%esi
  8009dc:	09 ce                	or     %ecx,%esi
  8009de:	09 d6                	or     %edx,%esi
  8009e0:	f7 c6 03 00 00 00    	test   $0x3,%esi
  8009e6:	75 0e                	jne    8009f6 <memmove+0x3c>
			asm volatile("std; rep movsl\n"
				:: "D" (d-4), "S" (s-4), "c" (n/4) : "cc", "memory");
  8009e8:	83 ef 04             	sub    $0x4,%edi
  8009eb:	8d 72 fc             	lea    -0x4(%edx),%esi
  8009ee:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("std; rep movsl\n"
  8009f1:	fd                   	std    
  8009f2:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  8009f4:	eb 09                	jmp    8009ff <memmove+0x45>
		else
			asm volatile("std; rep movsb\n"
				:: "D" (d-1), "S" (s-1), "c" (n) : "cc", "memory");
  8009f6:	83 ef 01             	sub    $0x1,%edi
  8009f9:	8d 72 ff             	lea    -0x1(%edx),%esi
			asm volatile("std; rep movsb\n"
  8009fc:	fd                   	std    
  8009fd:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
		// Some versions of GCC rely on DF being clear
		asm volatile("cld" ::: "cc");
  8009ff:	fc                   	cld    
  800a00:	eb 1a                	jmp    800a1c <memmove+0x62>
	} else {
		if ((int)s%4 == 0 && (int)d%4 == 0 && n%4 == 0)
  800a02:	89 c2                	mov    %eax,%edx
  800a04:	09 ca                	or     %ecx,%edx
  800a06:	09 f2                	or     %esi,%edx
  800a08:	f6 c2 03             	test   $0x3,%dl
  800a0b:	75 0a                	jne    800a17 <memmove+0x5d>
			asm volatile("cld; rep movsl\n"
				:: "D" (d), "S" (s), "c" (n/4) : "cc", "memory");
  800a0d:	c1 e9 02             	shr    $0x2,%ecx
			asm volatile("cld; rep movsl\n"
  800a10:	89 c7                	mov    %eax,%edi
  800a12:	fc                   	cld    
  800a13:	f3 a5                	rep movsl %ds:(%esi),%es:(%edi)
  800a15:	eb 05                	jmp    800a1c <memmove+0x62>
		else
			asm volatile("cld; rep movsb\n"
  800a17:	89 c7                	mov    %eax,%edi
  800a19:	fc                   	cld    
  800a1a:	f3 a4                	rep movsb %ds:(%esi),%es:(%edi)
				:: "D" (d), "S" (s), "c" (n) : "cc", "memory");
	}
	return dst;
}
  800a1c:	5e                   	pop    %esi
  800a1d:	5f                   	pop    %edi
  800a1e:	5d                   	pop    %ebp
  800a1f:	c3                   	ret    

00800a20 <memcpy>:
}
#endif

void *
memcpy(void *dst, const void *src, size_t n)
{
  800a20:	f3 0f 1e fb          	endbr32 
  800a24:	55                   	push   %ebp
  800a25:	89 e5                	mov    %esp,%ebp
  800a27:	83 ec 0c             	sub    $0xc,%esp
	return memmove(dst, src, n);
  800a2a:	ff 75 10             	pushl  0x10(%ebp)
  800a2d:	ff 75 0c             	pushl  0xc(%ebp)
  800a30:	ff 75 08             	pushl  0x8(%ebp)
  800a33:	e8 82 ff ff ff       	call   8009ba <memmove>
}
  800a38:	c9                   	leave  
  800a39:	c3                   	ret    

00800a3a <memcmp>:

int
memcmp(const void *v1, const void *v2, size_t n)
{
  800a3a:	f3 0f 1e fb          	endbr32 
  800a3e:	55                   	push   %ebp
  800a3f:	89 e5                	mov    %esp,%ebp
  800a41:	56                   	push   %esi
  800a42:	53                   	push   %ebx
  800a43:	8b 45 08             	mov    0x8(%ebp),%eax
  800a46:	8b 55 0c             	mov    0xc(%ebp),%edx
  800a49:	89 c6                	mov    %eax,%esi
  800a4b:	03 75 10             	add    0x10(%ebp),%esi
	const uint8_t *s1 = (const uint8_t *) v1;
	const uint8_t *s2 = (const uint8_t *) v2;

	while (n-- > 0) {
  800a4e:	39 f0                	cmp    %esi,%eax
  800a50:	74 1c                	je     800a6e <memcmp+0x34>
		if (*s1 != *s2)
  800a52:	0f b6 08             	movzbl (%eax),%ecx
  800a55:	0f b6 1a             	movzbl (%edx),%ebx
  800a58:	38 d9                	cmp    %bl,%cl
  800a5a:	75 08                	jne    800a64 <memcmp+0x2a>
			return (int) *s1 - (int) *s2;
		s1++, s2++;
  800a5c:	83 c0 01             	add    $0x1,%eax
  800a5f:	83 c2 01             	add    $0x1,%edx
  800a62:	eb ea                	jmp    800a4e <memcmp+0x14>
			return (int) *s1 - (int) *s2;
  800a64:	0f b6 c1             	movzbl %cl,%eax
  800a67:	0f b6 db             	movzbl %bl,%ebx
  800a6a:	29 d8                	sub    %ebx,%eax
  800a6c:	eb 05                	jmp    800a73 <memcmp+0x39>
	}

	return 0;
  800a6e:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800a73:	5b                   	pop    %ebx
  800a74:	5e                   	pop    %esi
  800a75:	5d                   	pop    %ebp
  800a76:	c3                   	ret    

00800a77 <memfind>:

void *
memfind(const void *s, int c, size_t n)
{
  800a77:	f3 0f 1e fb          	endbr32 
  800a7b:	55                   	push   %ebp
  800a7c:	89 e5                	mov    %esp,%ebp
  800a7e:	8b 45 08             	mov    0x8(%ebp),%eax
  800a81:	8b 4d 0c             	mov    0xc(%ebp),%ecx
	const void *ends = (const char *) s + n;
  800a84:	89 c2                	mov    %eax,%edx
  800a86:	03 55 10             	add    0x10(%ebp),%edx
	for (; s < ends; s++)
  800a89:	39 d0                	cmp    %edx,%eax
  800a8b:	73 09                	jae    800a96 <memfind+0x1f>
		if (*(const unsigned char *) s == (unsigned char) c)
  800a8d:	38 08                	cmp    %cl,(%eax)
  800a8f:	74 05                	je     800a96 <memfind+0x1f>
	for (; s < ends; s++)
  800a91:	83 c0 01             	add    $0x1,%eax
  800a94:	eb f3                	jmp    800a89 <memfind+0x12>
			break;
	return (void *) s;
}
  800a96:	5d                   	pop    %ebp
  800a97:	c3                   	ret    

00800a98 <strtol>:

long
strtol(const char *s, char **endptr, int base)
{
  800a98:	f3 0f 1e fb          	endbr32 
  800a9c:	55                   	push   %ebp
  800a9d:	89 e5                	mov    %esp,%ebp
  800a9f:	57                   	push   %edi
  800aa0:	56                   	push   %esi
  800aa1:	53                   	push   %ebx
  800aa2:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800aa5:	8b 5d 10             	mov    0x10(%ebp),%ebx
	int neg = 0;
	long val = 0;

	// gobble initial whitespace
	while (*s == ' ' || *s == '\t')
  800aa8:	eb 03                	jmp    800aad <strtol+0x15>
		s++;
  800aaa:	83 c1 01             	add    $0x1,%ecx
	while (*s == ' ' || *s == '\t')
  800aad:	0f b6 01             	movzbl (%ecx),%eax
  800ab0:	3c 20                	cmp    $0x20,%al
  800ab2:	74 f6                	je     800aaa <strtol+0x12>
  800ab4:	3c 09                	cmp    $0x9,%al
  800ab6:	74 f2                	je     800aaa <strtol+0x12>

	// plus/minus sign
	if (*s == '+')
  800ab8:	3c 2b                	cmp    $0x2b,%al
  800aba:	74 2a                	je     800ae6 <strtol+0x4e>
	int neg = 0;
  800abc:	bf 00 00 00 00       	mov    $0x0,%edi
		s++;
	else if (*s == '-')
  800ac1:	3c 2d                	cmp    $0x2d,%al
  800ac3:	74 2b                	je     800af0 <strtol+0x58>
		s++, neg = 1;

	// hex or octal base prefix
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800ac5:	f7 c3 ef ff ff ff    	test   $0xffffffef,%ebx
  800acb:	75 0f                	jne    800adc <strtol+0x44>
  800acd:	80 39 30             	cmpb   $0x30,(%ecx)
  800ad0:	74 28                	je     800afa <strtol+0x62>
		s += 2, base = 16;
	else if (base == 0 && s[0] == '0')
		s++, base = 8;
	else if (base == 0)
		base = 10;
  800ad2:	85 db                	test   %ebx,%ebx
  800ad4:	b8 0a 00 00 00       	mov    $0xa,%eax
  800ad9:	0f 44 d8             	cmove  %eax,%ebx
  800adc:	b8 00 00 00 00       	mov    $0x0,%eax
  800ae1:	89 5d 10             	mov    %ebx,0x10(%ebp)
  800ae4:	eb 46                	jmp    800b2c <strtol+0x94>
		s++;
  800ae6:	83 c1 01             	add    $0x1,%ecx
	int neg = 0;
  800ae9:	bf 00 00 00 00       	mov    $0x0,%edi
  800aee:	eb d5                	jmp    800ac5 <strtol+0x2d>
		s++, neg = 1;
  800af0:	83 c1 01             	add    $0x1,%ecx
  800af3:	bf 01 00 00 00       	mov    $0x1,%edi
  800af8:	eb cb                	jmp    800ac5 <strtol+0x2d>
	if ((base == 0 || base == 16) && (s[0] == '0' && s[1] == 'x'))
  800afa:	80 79 01 78          	cmpb   $0x78,0x1(%ecx)
  800afe:	74 0e                	je     800b0e <strtol+0x76>
	else if (base == 0 && s[0] == '0')
  800b00:	85 db                	test   %ebx,%ebx
  800b02:	75 d8                	jne    800adc <strtol+0x44>
		s++, base = 8;
  800b04:	83 c1 01             	add    $0x1,%ecx
  800b07:	bb 08 00 00 00       	mov    $0x8,%ebx
  800b0c:	eb ce                	jmp    800adc <strtol+0x44>
		s += 2, base = 16;
  800b0e:	83 c1 02             	add    $0x2,%ecx
  800b11:	bb 10 00 00 00       	mov    $0x10,%ebx
  800b16:	eb c4                	jmp    800adc <strtol+0x44>
	// digits
	while (1) {
		int dig;

		if (*s >= '0' && *s <= '9')
			dig = *s - '0';
  800b18:	0f be d2             	movsbl %dl,%edx
  800b1b:	83 ea 30             	sub    $0x30,%edx
			dig = *s - 'a' + 10;
		else if (*s >= 'A' && *s <= 'Z')
			dig = *s - 'A' + 10;
		else
			break;
		if (dig >= base)
  800b1e:	3b 55 10             	cmp    0x10(%ebp),%edx
  800b21:	7d 3a                	jge    800b5d <strtol+0xc5>
			break;
		s++, val = (val * base) + dig;
  800b23:	83 c1 01             	add    $0x1,%ecx
  800b26:	0f af 45 10          	imul   0x10(%ebp),%eax
  800b2a:	01 d0                	add    %edx,%eax
		if (*s >= '0' && *s <= '9')
  800b2c:	0f b6 11             	movzbl (%ecx),%edx
  800b2f:	8d 72 d0             	lea    -0x30(%edx),%esi
  800b32:	89 f3                	mov    %esi,%ebx
  800b34:	80 fb 09             	cmp    $0x9,%bl
  800b37:	76 df                	jbe    800b18 <strtol+0x80>
		else if (*s >= 'a' && *s <= 'z')
  800b39:	8d 72 9f             	lea    -0x61(%edx),%esi
  800b3c:	89 f3                	mov    %esi,%ebx
  800b3e:	80 fb 19             	cmp    $0x19,%bl
  800b41:	77 08                	ja     800b4b <strtol+0xb3>
			dig = *s - 'a' + 10;
  800b43:	0f be d2             	movsbl %dl,%edx
  800b46:	83 ea 57             	sub    $0x57,%edx
  800b49:	eb d3                	jmp    800b1e <strtol+0x86>
		else if (*s >= 'A' && *s <= 'Z')
  800b4b:	8d 72 bf             	lea    -0x41(%edx),%esi
  800b4e:	89 f3                	mov    %esi,%ebx
  800b50:	80 fb 19             	cmp    $0x19,%bl
  800b53:	77 08                	ja     800b5d <strtol+0xc5>
			dig = *s - 'A' + 10;
  800b55:	0f be d2             	movsbl %dl,%edx
  800b58:	83 ea 37             	sub    $0x37,%edx
  800b5b:	eb c1                	jmp    800b1e <strtol+0x86>
		// we don't properly detect overflow!
	}

	if (endptr)
  800b5d:	83 7d 0c 00          	cmpl   $0x0,0xc(%ebp)
  800b61:	74 05                	je     800b68 <strtol+0xd0>
		*endptr = (char *) s;
  800b63:	8b 75 0c             	mov    0xc(%ebp),%esi
  800b66:	89 0e                	mov    %ecx,(%esi)
	return (neg ? -val : val);
  800b68:	89 c2                	mov    %eax,%edx
  800b6a:	f7 da                	neg    %edx
  800b6c:	85 ff                	test   %edi,%edi
  800b6e:	0f 45 c2             	cmovne %edx,%eax
}
  800b71:	5b                   	pop    %ebx
  800b72:	5e                   	pop    %esi
  800b73:	5f                   	pop    %edi
  800b74:	5d                   	pop    %ebp
  800b75:	c3                   	ret    

00800b76 <sys_cputs>:
	return ret;
}

void
sys_cputs(const char *s, size_t len)
{
  800b76:	f3 0f 1e fb          	endbr32 
  800b7a:	55                   	push   %ebp
  800b7b:	89 e5                	mov    %esp,%ebp
  800b7d:	57                   	push   %edi
  800b7e:	56                   	push   %esi
  800b7f:	53                   	push   %ebx
	asm volatile("int %1\n"
  800b80:	b8 00 00 00 00       	mov    $0x0,%eax
  800b85:	8b 55 08             	mov    0x8(%ebp),%edx
  800b88:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800b8b:	89 c3                	mov    %eax,%ebx
  800b8d:	89 c7                	mov    %eax,%edi
  800b8f:	89 c6                	mov    %eax,%esi
  800b91:	cd 30                	int    $0x30
	syscall(SYS_cputs, 0, (uint32_t)s, len, 0, 0, 0);
}
  800b93:	5b                   	pop    %ebx
  800b94:	5e                   	pop    %esi
  800b95:	5f                   	pop    %edi
  800b96:	5d                   	pop    %ebp
  800b97:	c3                   	ret    

00800b98 <sys_cgetc>:

int
sys_cgetc(void)
{
  800b98:	f3 0f 1e fb          	endbr32 
  800b9c:	55                   	push   %ebp
  800b9d:	89 e5                	mov    %esp,%ebp
  800b9f:	57                   	push   %edi
  800ba0:	56                   	push   %esi
  800ba1:	53                   	push   %ebx
	asm volatile("int %1\n"
  800ba2:	ba 00 00 00 00       	mov    $0x0,%edx
  800ba7:	b8 01 00 00 00       	mov    $0x1,%eax
  800bac:	89 d1                	mov    %edx,%ecx
  800bae:	89 d3                	mov    %edx,%ebx
  800bb0:	89 d7                	mov    %edx,%edi
  800bb2:	89 d6                	mov    %edx,%esi
  800bb4:	cd 30                	int    $0x30
	return syscall(SYS_cgetc, 0, 0, 0, 0, 0, 0);
}
  800bb6:	5b                   	pop    %ebx
  800bb7:	5e                   	pop    %esi
  800bb8:	5f                   	pop    %edi
  800bb9:	5d                   	pop    %ebp
  800bba:	c3                   	ret    

00800bbb <sys_env_destroy>:

int
sys_env_destroy(envid_t envid)
{
  800bbb:	f3 0f 1e fb          	endbr32 
  800bbf:	55                   	push   %ebp
  800bc0:	89 e5                	mov    %esp,%ebp
  800bc2:	57                   	push   %edi
  800bc3:	56                   	push   %esi
  800bc4:	53                   	push   %ebx
  800bc5:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800bc8:	b9 00 00 00 00       	mov    $0x0,%ecx
  800bcd:	8b 55 08             	mov    0x8(%ebp),%edx
  800bd0:	b8 03 00 00 00       	mov    $0x3,%eax
  800bd5:	89 cb                	mov    %ecx,%ebx
  800bd7:	89 cf                	mov    %ecx,%edi
  800bd9:	89 ce                	mov    %ecx,%esi
  800bdb:	cd 30                	int    $0x30
	if(check && ret > 0)
  800bdd:	85 c0                	test   %eax,%eax
  800bdf:	7f 08                	jg     800be9 <sys_env_destroy+0x2e>
	return syscall(SYS_env_destroy, 1, envid, 0, 0, 0, 0);
}
  800be1:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800be4:	5b                   	pop    %ebx
  800be5:	5e                   	pop    %esi
  800be6:	5f                   	pop    %edi
  800be7:	5d                   	pop    %ebp
  800be8:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800be9:	83 ec 0c             	sub    $0xc,%esp
  800bec:	50                   	push   %eax
  800bed:	6a 03                	push   $0x3
  800bef:	68 9f 23 80 00       	push   $0x80239f
  800bf4:	6a 23                	push   $0x23
  800bf6:	68 bc 23 80 00       	push   $0x8023bc
  800bfb:	e8 44 f5 ff ff       	call   800144 <_panic>

00800c00 <sys_getenvid>:

envid_t
sys_getenvid(void)
{
  800c00:	f3 0f 1e fb          	endbr32 
  800c04:	55                   	push   %ebp
  800c05:	89 e5                	mov    %esp,%ebp
  800c07:	57                   	push   %edi
  800c08:	56                   	push   %esi
  800c09:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c0a:	ba 00 00 00 00       	mov    $0x0,%edx
  800c0f:	b8 02 00 00 00       	mov    $0x2,%eax
  800c14:	89 d1                	mov    %edx,%ecx
  800c16:	89 d3                	mov    %edx,%ebx
  800c18:	89 d7                	mov    %edx,%edi
  800c1a:	89 d6                	mov    %edx,%esi
  800c1c:	cd 30                	int    $0x30
	 return syscall(SYS_getenvid, 0, 0, 0, 0, 0, 0);
}
  800c1e:	5b                   	pop    %ebx
  800c1f:	5e                   	pop    %esi
  800c20:	5f                   	pop    %edi
  800c21:	5d                   	pop    %ebp
  800c22:	c3                   	ret    

00800c23 <sys_yield>:

void
sys_yield(void)
{
  800c23:	f3 0f 1e fb          	endbr32 
  800c27:	55                   	push   %ebp
  800c28:	89 e5                	mov    %esp,%ebp
  800c2a:	57                   	push   %edi
  800c2b:	56                   	push   %esi
  800c2c:	53                   	push   %ebx
	asm volatile("int %1\n"
  800c2d:	ba 00 00 00 00       	mov    $0x0,%edx
  800c32:	b8 0b 00 00 00       	mov    $0xb,%eax
  800c37:	89 d1                	mov    %edx,%ecx
  800c39:	89 d3                	mov    %edx,%ebx
  800c3b:	89 d7                	mov    %edx,%edi
  800c3d:	89 d6                	mov    %edx,%esi
  800c3f:	cd 30                	int    $0x30
	syscall(SYS_yield, 0, 0, 0, 0, 0, 0);
}
  800c41:	5b                   	pop    %ebx
  800c42:	5e                   	pop    %esi
  800c43:	5f                   	pop    %edi
  800c44:	5d                   	pop    %ebp
  800c45:	c3                   	ret    

00800c46 <sys_page_alloc>:

int
sys_page_alloc(envid_t envid, void *va, int perm)
{
  800c46:	f3 0f 1e fb          	endbr32 
  800c4a:	55                   	push   %ebp
  800c4b:	89 e5                	mov    %esp,%ebp
  800c4d:	57                   	push   %edi
  800c4e:	56                   	push   %esi
  800c4f:	53                   	push   %ebx
  800c50:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c53:	be 00 00 00 00       	mov    $0x0,%esi
  800c58:	8b 55 08             	mov    0x8(%ebp),%edx
  800c5b:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800c5e:	b8 04 00 00 00       	mov    $0x4,%eax
  800c63:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800c66:	89 f7                	mov    %esi,%edi
  800c68:	cd 30                	int    $0x30
	if(check && ret > 0)
  800c6a:	85 c0                	test   %eax,%eax
  800c6c:	7f 08                	jg     800c76 <sys_page_alloc+0x30>
	return syscall(SYS_page_alloc, 1, envid, (uint32_t) va, perm, 0, 0);
}
  800c6e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800c71:	5b                   	pop    %ebx
  800c72:	5e                   	pop    %esi
  800c73:	5f                   	pop    %edi
  800c74:	5d                   	pop    %ebp
  800c75:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800c76:	83 ec 0c             	sub    $0xc,%esp
  800c79:	50                   	push   %eax
  800c7a:	6a 04                	push   $0x4
  800c7c:	68 9f 23 80 00       	push   $0x80239f
  800c81:	6a 23                	push   $0x23
  800c83:	68 bc 23 80 00       	push   $0x8023bc
  800c88:	e8 b7 f4 ff ff       	call   800144 <_panic>

00800c8d <sys_page_map>:

int
sys_page_map(envid_t srcenv, void *srcva, envid_t dstenv, void *dstva, int perm)
{
  800c8d:	f3 0f 1e fb          	endbr32 
  800c91:	55                   	push   %ebp
  800c92:	89 e5                	mov    %esp,%ebp
  800c94:	57                   	push   %edi
  800c95:	56                   	push   %esi
  800c96:	53                   	push   %ebx
  800c97:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800c9a:	8b 55 08             	mov    0x8(%ebp),%edx
  800c9d:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ca0:	b8 05 00 00 00       	mov    $0x5,%eax
  800ca5:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800ca8:	8b 7d 14             	mov    0x14(%ebp),%edi
  800cab:	8b 75 18             	mov    0x18(%ebp),%esi
  800cae:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cb0:	85 c0                	test   %eax,%eax
  800cb2:	7f 08                	jg     800cbc <sys_page_map+0x2f>
	return syscall(SYS_page_map, 1, srcenv, (uint32_t) srcva, dstenv, (uint32_t) dstva, perm);
}
  800cb4:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cb7:	5b                   	pop    %ebx
  800cb8:	5e                   	pop    %esi
  800cb9:	5f                   	pop    %edi
  800cba:	5d                   	pop    %ebp
  800cbb:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800cbc:	83 ec 0c             	sub    $0xc,%esp
  800cbf:	50                   	push   %eax
  800cc0:	6a 05                	push   $0x5
  800cc2:	68 9f 23 80 00       	push   $0x80239f
  800cc7:	6a 23                	push   $0x23
  800cc9:	68 bc 23 80 00       	push   $0x8023bc
  800cce:	e8 71 f4 ff ff       	call   800144 <_panic>

00800cd3 <sys_page_unmap>:

int
sys_page_unmap(envid_t envid, void *va)
{
  800cd3:	f3 0f 1e fb          	endbr32 
  800cd7:	55                   	push   %ebp
  800cd8:	89 e5                	mov    %esp,%ebp
  800cda:	57                   	push   %edi
  800cdb:	56                   	push   %esi
  800cdc:	53                   	push   %ebx
  800cdd:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800ce0:	bb 00 00 00 00       	mov    $0x0,%ebx
  800ce5:	8b 55 08             	mov    0x8(%ebp),%edx
  800ce8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800ceb:	b8 06 00 00 00       	mov    $0x6,%eax
  800cf0:	89 df                	mov    %ebx,%edi
  800cf2:	89 de                	mov    %ebx,%esi
  800cf4:	cd 30                	int    $0x30
	if(check && ret > 0)
  800cf6:	85 c0                	test   %eax,%eax
  800cf8:	7f 08                	jg     800d02 <sys_page_unmap+0x2f>
	return syscall(SYS_page_unmap, 1, envid, (uint32_t) va, 0, 0, 0);
}
  800cfa:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800cfd:	5b                   	pop    %ebx
  800cfe:	5e                   	pop    %esi
  800cff:	5f                   	pop    %edi
  800d00:	5d                   	pop    %ebp
  800d01:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d02:	83 ec 0c             	sub    $0xc,%esp
  800d05:	50                   	push   %eax
  800d06:	6a 06                	push   $0x6
  800d08:	68 9f 23 80 00       	push   $0x80239f
  800d0d:	6a 23                	push   $0x23
  800d0f:	68 bc 23 80 00       	push   $0x8023bc
  800d14:	e8 2b f4 ff ff       	call   800144 <_panic>

00800d19 <sys_env_set_status>:

// sys_exofork is inlined in lib.h

int
sys_env_set_status(envid_t envid, int status)
{
  800d19:	f3 0f 1e fb          	endbr32 
  800d1d:	55                   	push   %ebp
  800d1e:	89 e5                	mov    %esp,%ebp
  800d20:	57                   	push   %edi
  800d21:	56                   	push   %esi
  800d22:	53                   	push   %ebx
  800d23:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d26:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d2b:	8b 55 08             	mov    0x8(%ebp),%edx
  800d2e:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d31:	b8 08 00 00 00       	mov    $0x8,%eax
  800d36:	89 df                	mov    %ebx,%edi
  800d38:	89 de                	mov    %ebx,%esi
  800d3a:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d3c:	85 c0                	test   %eax,%eax
  800d3e:	7f 08                	jg     800d48 <sys_env_set_status+0x2f>
	return syscall(SYS_env_set_status, 1, envid, status, 0, 0, 0);
}
  800d40:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d43:	5b                   	pop    %ebx
  800d44:	5e                   	pop    %esi
  800d45:	5f                   	pop    %edi
  800d46:	5d                   	pop    %ebp
  800d47:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d48:	83 ec 0c             	sub    $0xc,%esp
  800d4b:	50                   	push   %eax
  800d4c:	6a 08                	push   $0x8
  800d4e:	68 9f 23 80 00       	push   $0x80239f
  800d53:	6a 23                	push   $0x23
  800d55:	68 bc 23 80 00       	push   $0x8023bc
  800d5a:	e8 e5 f3 ff ff       	call   800144 <_panic>

00800d5f <sys_env_set_trapframe>:

int
sys_env_set_trapframe(envid_t envid, struct Trapframe *tf)
{
  800d5f:	f3 0f 1e fb          	endbr32 
  800d63:	55                   	push   %ebp
  800d64:	89 e5                	mov    %esp,%ebp
  800d66:	57                   	push   %edi
  800d67:	56                   	push   %esi
  800d68:	53                   	push   %ebx
  800d69:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800d6c:	bb 00 00 00 00       	mov    $0x0,%ebx
  800d71:	8b 55 08             	mov    0x8(%ebp),%edx
  800d74:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800d77:	b8 09 00 00 00       	mov    $0x9,%eax
  800d7c:	89 df                	mov    %ebx,%edi
  800d7e:	89 de                	mov    %ebx,%esi
  800d80:	cd 30                	int    $0x30
	if(check && ret > 0)
  800d82:	85 c0                	test   %eax,%eax
  800d84:	7f 08                	jg     800d8e <sys_env_set_trapframe+0x2f>
	return syscall(SYS_env_set_trapframe, 1, envid, (uint32_t) tf, 0, 0, 0);
}
  800d86:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800d89:	5b                   	pop    %ebx
  800d8a:	5e                   	pop    %esi
  800d8b:	5f                   	pop    %edi
  800d8c:	5d                   	pop    %ebp
  800d8d:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800d8e:	83 ec 0c             	sub    $0xc,%esp
  800d91:	50                   	push   %eax
  800d92:	6a 09                	push   $0x9
  800d94:	68 9f 23 80 00       	push   $0x80239f
  800d99:	6a 23                	push   $0x23
  800d9b:	68 bc 23 80 00       	push   $0x8023bc
  800da0:	e8 9f f3 ff ff       	call   800144 <_panic>

00800da5 <sys_env_set_pgfault_upcall>:

int
sys_env_set_pgfault_upcall(envid_t envid, void *upcall)
{
  800da5:	f3 0f 1e fb          	endbr32 
  800da9:	55                   	push   %ebp
  800daa:	89 e5                	mov    %esp,%ebp
  800dac:	57                   	push   %edi
  800dad:	56                   	push   %esi
  800dae:	53                   	push   %ebx
  800daf:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800db2:	bb 00 00 00 00       	mov    $0x0,%ebx
  800db7:	8b 55 08             	mov    0x8(%ebp),%edx
  800dba:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800dbd:	b8 0a 00 00 00       	mov    $0xa,%eax
  800dc2:	89 df                	mov    %ebx,%edi
  800dc4:	89 de                	mov    %ebx,%esi
  800dc6:	cd 30                	int    $0x30
	if(check && ret > 0)
  800dc8:	85 c0                	test   %eax,%eax
  800dca:	7f 08                	jg     800dd4 <sys_env_set_pgfault_upcall+0x2f>
	return syscall(SYS_env_set_pgfault_upcall, 1, envid, (uint32_t) upcall, 0, 0, 0);
}
  800dcc:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800dcf:	5b                   	pop    %ebx
  800dd0:	5e                   	pop    %esi
  800dd1:	5f                   	pop    %edi
  800dd2:	5d                   	pop    %ebp
  800dd3:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800dd4:	83 ec 0c             	sub    $0xc,%esp
  800dd7:	50                   	push   %eax
  800dd8:	6a 0a                	push   $0xa
  800dda:	68 9f 23 80 00       	push   $0x80239f
  800ddf:	6a 23                	push   $0x23
  800de1:	68 bc 23 80 00       	push   $0x8023bc
  800de6:	e8 59 f3 ff ff       	call   800144 <_panic>

00800deb <sys_ipc_try_send>:

int
sys_ipc_try_send(envid_t envid, uint32_t value, void *srcva, int perm)
{
  800deb:	f3 0f 1e fb          	endbr32 
  800def:	55                   	push   %ebp
  800df0:	89 e5                	mov    %esp,%ebp
  800df2:	57                   	push   %edi
  800df3:	56                   	push   %esi
  800df4:	53                   	push   %ebx
	asm volatile("int %1\n"
  800df5:	8b 55 08             	mov    0x8(%ebp),%edx
  800df8:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  800dfb:	b8 0c 00 00 00       	mov    $0xc,%eax
  800e00:	be 00 00 00 00       	mov    $0x0,%esi
  800e05:	8b 5d 10             	mov    0x10(%ebp),%ebx
  800e08:	8b 7d 14             	mov    0x14(%ebp),%edi
  800e0b:	cd 30                	int    $0x30
	return syscall(SYS_ipc_try_send, 0, envid, value, (uint32_t) srcva, perm, 0);
}
  800e0d:	5b                   	pop    %ebx
  800e0e:	5e                   	pop    %esi
  800e0f:	5f                   	pop    %edi
  800e10:	5d                   	pop    %ebp
  800e11:	c3                   	ret    

00800e12 <sys_ipc_recv>:

int
sys_ipc_recv(void *dstva)
{
  800e12:	f3 0f 1e fb          	endbr32 
  800e16:	55                   	push   %ebp
  800e17:	89 e5                	mov    %esp,%ebp
  800e19:	57                   	push   %edi
  800e1a:	56                   	push   %esi
  800e1b:	53                   	push   %ebx
  800e1c:	83 ec 0c             	sub    $0xc,%esp
	asm volatile("int %1\n"
  800e1f:	b9 00 00 00 00       	mov    $0x0,%ecx
  800e24:	8b 55 08             	mov    0x8(%ebp),%edx
  800e27:	b8 0d 00 00 00       	mov    $0xd,%eax
  800e2c:	89 cb                	mov    %ecx,%ebx
  800e2e:	89 cf                	mov    %ecx,%edi
  800e30:	89 ce                	mov    %ecx,%esi
  800e32:	cd 30                	int    $0x30
	if(check && ret > 0)
  800e34:	85 c0                	test   %eax,%eax
  800e36:	7f 08                	jg     800e40 <sys_ipc_recv+0x2e>
	return syscall(SYS_ipc_recv, 1, (uint32_t)dstva, 0, 0, 0, 0);
}
  800e38:	8d 65 f4             	lea    -0xc(%ebp),%esp
  800e3b:	5b                   	pop    %ebx
  800e3c:	5e                   	pop    %esi
  800e3d:	5f                   	pop    %edi
  800e3e:	5d                   	pop    %ebp
  800e3f:	c3                   	ret    
		panic("syscall %d returned %d (> 0)", num, ret);
  800e40:	83 ec 0c             	sub    $0xc,%esp
  800e43:	50                   	push   %eax
  800e44:	6a 0d                	push   $0xd
  800e46:	68 9f 23 80 00       	push   $0x80239f
  800e4b:	6a 23                	push   $0x23
  800e4d:	68 bc 23 80 00       	push   $0x8023bc
  800e52:	e8 ed f2 ff ff       	call   800144 <_panic>

00800e57 <set_pgfault_handler>:
// at UXSTACKTOP), and tell the kernel to call the assembly-language
// _pgfault_upcall routine when a page fault occurs.
//
void
set_pgfault_handler(void (*handler)(struct UTrapframe *utf))
{
  800e57:	f3 0f 1e fb          	endbr32 
  800e5b:	55                   	push   %ebp
  800e5c:	89 e5                	mov    %esp,%ebp
  800e5e:	83 ec 08             	sub    $0x8,%esp
	int r;

	if (_pgfault_handler == 0) {
  800e61:	83 3d 08 40 80 00 00 	cmpl   $0x0,0x804008
  800e68:	74 27                	je     800e91 <set_pgfault_handler+0x3a>
		if(sys_page_alloc(0,(void *)UXSTACKTOP-PGSIZE,PTE_W|PTE_U|PTE_P)<0)
			panic("set_pgfault_handler:sys_page_alloc failed");
	}

	// Save handler pointer for assembly to call.
	_pgfault_handler = handler;
  800e6a:	8b 45 08             	mov    0x8(%ebp),%eax
  800e6d:	a3 08 40 80 00       	mov    %eax,0x804008
	if (sys_env_set_pgfault_upcall(thisenv->env_id,_pgfault_upcall)<0)	
  800e72:	a1 04 40 80 00       	mov    0x804004,%eax
  800e77:	8b 40 48             	mov    0x48(%eax),%eax
  800e7a:	83 ec 08             	sub    $0x8,%esp
  800e7d:	68 d1 0e 80 00       	push   $0x800ed1
  800e82:	50                   	push   %eax
  800e83:	e8 1d ff ff ff       	call   800da5 <sys_env_set_pgfault_upcall>
  800e88:	83 c4 10             	add    $0x10,%esp
  800e8b:	85 c0                	test   %eax,%eax
  800e8d:	78 2e                	js     800ebd <set_pgfault_handler+0x66>
        panic("set_pgfault_handler:sys_env_set_pgfault_upcall failed");
}
  800e8f:	c9                   	leave  
  800e90:	c3                   	ret    
		if(sys_page_alloc(0,(void *)UXSTACKTOP-PGSIZE,PTE_W|PTE_U|PTE_P)<0)
  800e91:	83 ec 04             	sub    $0x4,%esp
  800e94:	6a 07                	push   $0x7
  800e96:	68 00 f0 bf ee       	push   $0xeebff000
  800e9b:	6a 00                	push   $0x0
  800e9d:	e8 a4 fd ff ff       	call   800c46 <sys_page_alloc>
  800ea2:	83 c4 10             	add    $0x10,%esp
  800ea5:	85 c0                	test   %eax,%eax
  800ea7:	79 c1                	jns    800e6a <set_pgfault_handler+0x13>
			panic("set_pgfault_handler:sys_page_alloc failed");
  800ea9:	83 ec 04             	sub    $0x4,%esp
  800eac:	68 cc 23 80 00       	push   $0x8023cc
  800eb1:	6a 21                	push   $0x21
  800eb3:	68 2e 24 80 00       	push   $0x80242e
  800eb8:	e8 87 f2 ff ff       	call   800144 <_panic>
        panic("set_pgfault_handler:sys_env_set_pgfault_upcall failed");
  800ebd:	83 ec 04             	sub    $0x4,%esp
  800ec0:	68 f8 23 80 00       	push   $0x8023f8
  800ec5:	6a 27                	push   $0x27
  800ec7:	68 2e 24 80 00       	push   $0x80242e
  800ecc:	e8 73 f2 ff ff       	call   800144 <_panic>

00800ed1 <_pgfault_upcall>:

.text
.globl _pgfault_upcall
_pgfault_upcall:
	// Call the C page fault handler.
	pushl %esp			// function argument: pointer to UTF
  800ed1:	54                   	push   %esp
	movl _pgfault_handler, %eax
  800ed2:	a1 08 40 80 00       	mov    0x804008,%eax
	call *%eax
  800ed7:	ff d0                	call   *%eax
	addl $4, %esp			// pop function argument
  800ed9:	83 c4 04             	add    $0x4,%esp
	// may find that you have to rearrange your code in non-obvious
	// ways as registers become unavailable as scratch space.
	//
	// LAB 4: Your code here.
	//首先把此时的eip指针下移48个字节因为UTrapFrame的大小是48个字节
	movl 48(%esp), %ebp
  800edc:	8b 6c 24 30          	mov    0x30(%esp),%ebp
    subl $4, %ebp		// UTrapFrame.utf_esp - 4 and store back 这里是由于之前预留了4个字节。
  800ee0:	83 ed 04             	sub    $0x4,%ebp
    movl %ebp, 48(%esp)	// 返回上一次的esp位置。
  800ee3:	89 6c 24 30          	mov    %ebp,0x30(%esp)

	// Restore the trap-time registers.  After you do this, you
	// can no longer modify any general-purpose registers.
	// LAB 4: Your code here.
	movl 40(%esp), %eax 
  800ee7:	8b 44 24 28          	mov    0x28(%esp),%eax
    movl %eax, (%ebp)
  800eeb:	89 45 00             	mov    %eax,0x0(%ebp)

	// Restore eflags from the stack.  After you do this, you can
	// no longer use arithmetic operations or anything else that
	// modifies eflags.
	// LAB 4: Your code here.
	addl $0x8, %esp         // Set %esp to the end of struct PushRegs
  800eee:	83 c4 08             	add    $0x8,%esp
	popal                   // Restore the trap-time registers.(struct PushRegs)
  800ef1:	61                   	popa   

	// Switch back to the adjusted trap-time stack.
	// LAB 4: Your code here.
	addl $0x4, %esp         // now we are located at trap-time eip,so we have to increment %esp with 4.【跳过eip】
  800ef2:	83 c4 04             	add    $0x4,%esp
	popfl                   // Restore eflags register.	【pop eflags】
  800ef5:	9d                   	popf   
	popl %esp               // Just restore the adjusted trap-time stack pointer.
  800ef6:	5c                   	pop    %esp
							// 恢复esp

	// Return to re-execute the instruction that faulted.
	// LAB 4: Your code here.
	ret                     // We are now on the trap-time stack,since we have saved trap-time eip above trap-time esp,ret instruction will pop this trap-time eip to register %eip which known as PC at this time.Thus,we can return to re-execute the instruction that faulted.
  800ef7:	c3                   	ret    

00800ef8 <fd2num>:
// File descriptor manipulators
// --------------------------------------------------------------

int
fd2num(struct Fd *fd)
{
  800ef8:	f3 0f 1e fb          	endbr32 
  800efc:	55                   	push   %ebp
  800efd:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800eff:	8b 45 08             	mov    0x8(%ebp),%eax
  800f02:	05 00 00 00 30       	add    $0x30000000,%eax
  800f07:	c1 e8 0c             	shr    $0xc,%eax
}
  800f0a:	5d                   	pop    %ebp
  800f0b:	c3                   	ret    

00800f0c <fd2data>:

char*
fd2data(struct Fd *fd)
{
  800f0c:	f3 0f 1e fb          	endbr32 
  800f10:	55                   	push   %ebp
  800f11:	89 e5                	mov    %esp,%ebp
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  800f13:	8b 45 08             	mov    0x8(%ebp),%eax
  800f16:	05 00 00 00 30       	add    $0x30000000,%eax
	return INDEX2DATA(fd2num(fd));
  800f1b:	25 00 f0 ff ff       	and    $0xfffff000,%eax
  800f20:	2d 00 00 fe 2f       	sub    $0x2ffe0000,%eax
}
  800f25:	5d                   	pop    %ebp
  800f26:	c3                   	ret    

00800f27 <fd_alloc>:
// Returns 0 on success, < 0 on error.  Errors are:
//	-E_MAX_FD: no more file descriptors
// On error, *fd_store is set to 0.
int
fd_alloc(struct Fd **fd_store)
{
  800f27:	f3 0f 1e fb          	endbr32 
  800f2b:	55                   	push   %ebp
  800f2c:	89 e5                	mov    %esp,%ebp
  800f2e:	b8 00 00 00 d0       	mov    $0xd0000000,%eax
	int i;
	struct Fd *fd;

	for (i = 0; i < MAXFD; i++) {
		fd = INDEX2FD(i);
		if ((uvpd[PDX(fd)] & PTE_P) == 0 || (uvpt[PGNUM(fd)] & PTE_P) == 0) {
  800f33:	89 c2                	mov    %eax,%edx
  800f35:	c1 ea 16             	shr    $0x16,%edx
  800f38:	8b 14 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%edx
  800f3f:	f6 c2 01             	test   $0x1,%dl
  800f42:	74 2d                	je     800f71 <fd_alloc+0x4a>
  800f44:	89 c2                	mov    %eax,%edx
  800f46:	c1 ea 0c             	shr    $0xc,%edx
  800f49:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800f50:	f6 c2 01             	test   $0x1,%dl
  800f53:	74 1c                	je     800f71 <fd_alloc+0x4a>
  800f55:	05 00 10 00 00       	add    $0x1000,%eax
	for (i = 0; i < MAXFD; i++) {
  800f5a:	3d 00 00 02 d0       	cmp    $0xd0020000,%eax
  800f5f:	75 d2                	jne    800f33 <fd_alloc+0xc>
			*fd_store = fd;
			return 0;
		}
	}
	*fd_store = 0;
  800f61:	8b 45 08             	mov    0x8(%ebp),%eax
  800f64:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_MAX_OPEN;
  800f6a:	b8 f6 ff ff ff       	mov    $0xfffffff6,%eax
  800f6f:	eb 0a                	jmp    800f7b <fd_alloc+0x54>
			*fd_store = fd;
  800f71:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800f74:	89 01                	mov    %eax,(%ecx)
			return 0;
  800f76:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800f7b:	5d                   	pop    %ebp
  800f7c:	c3                   	ret    

00800f7d <fd_lookup>:
// Returns 0 on success (the page is in range and mapped), < 0 on error.
// Errors are:
//	-E_INVAL: fdnum was either not in range or not mapped.
int
fd_lookup(int fdnum, struct Fd **fd_store)
{
  800f7d:	f3 0f 1e fb          	endbr32 
  800f81:	55                   	push   %ebp
  800f82:	89 e5                	mov    %esp,%ebp
  800f84:	8b 45 08             	mov    0x8(%ebp),%eax
	struct Fd *fd;

	if (fdnum < 0 || fdnum >= MAXFD) {
  800f87:	83 f8 1f             	cmp    $0x1f,%eax
  800f8a:	77 30                	ja     800fbc <fd_lookup+0x3f>
		if (debug)
			cprintf("[%08x] bad fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	fd = INDEX2FD(fdnum);
  800f8c:	c1 e0 0c             	shl    $0xc,%eax
  800f8f:	2d 00 00 00 30       	sub    $0x30000000,%eax
	if (!(uvpd[PDX(fd)] & PTE_P) || !(uvpt[PGNUM(fd)] & PTE_P)) {
  800f94:	8b 15 00 dd 7b ef    	mov    0xef7bdd00,%edx
  800f9a:	f6 c2 01             	test   $0x1,%dl
  800f9d:	74 24                	je     800fc3 <fd_lookup+0x46>
  800f9f:	89 c2                	mov    %eax,%edx
  800fa1:	c1 ea 0c             	shr    $0xc,%edx
  800fa4:	8b 14 95 00 00 40 ef 	mov    -0x10c00000(,%edx,4),%edx
  800fab:	f6 c2 01             	test   $0x1,%dl
  800fae:	74 1a                	je     800fca <fd_lookup+0x4d>
		if (debug)
			cprintf("[%08x] closed fd %d\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	*fd_store = fd;
  800fb0:	8b 55 0c             	mov    0xc(%ebp),%edx
  800fb3:	89 02                	mov    %eax,(%edx)
	return 0;
  800fb5:	b8 00 00 00 00       	mov    $0x0,%eax
}
  800fba:	5d                   	pop    %ebp
  800fbb:	c3                   	ret    
		return -E_INVAL;
  800fbc:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fc1:	eb f7                	jmp    800fba <fd_lookup+0x3d>
		return -E_INVAL;
  800fc3:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fc8:	eb f0                	jmp    800fba <fd_lookup+0x3d>
  800fca:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  800fcf:	eb e9                	jmp    800fba <fd_lookup+0x3d>

00800fd1 <dev_lookup>:
	0
};

int
dev_lookup(int dev_id, struct Dev **dev)
{
  800fd1:	f3 0f 1e fb          	endbr32 
  800fd5:	55                   	push   %ebp
  800fd6:	89 e5                	mov    %esp,%ebp
  800fd8:	83 ec 08             	sub    $0x8,%esp
  800fdb:	8b 4d 08             	mov    0x8(%ebp),%ecx
  800fde:	ba b8 24 80 00       	mov    $0x8024b8,%edx
	int i;
	for (i = 0; devtab[i]; i++)
  800fe3:	b8 04 30 80 00       	mov    $0x803004,%eax
		if (devtab[i]->dev_id == dev_id) {
  800fe8:	39 08                	cmp    %ecx,(%eax)
  800fea:	74 33                	je     80101f <dev_lookup+0x4e>
  800fec:	83 c2 04             	add    $0x4,%edx
	for (i = 0; devtab[i]; i++)
  800fef:	8b 02                	mov    (%edx),%eax
  800ff1:	85 c0                	test   %eax,%eax
  800ff3:	75 f3                	jne    800fe8 <dev_lookup+0x17>
			*dev = devtab[i];
			return 0;
		}
	cprintf("[%08x] unknown device type %d\n", thisenv->env_id, dev_id);
  800ff5:	a1 04 40 80 00       	mov    0x804004,%eax
  800ffa:	8b 40 48             	mov    0x48(%eax),%eax
  800ffd:	83 ec 04             	sub    $0x4,%esp
  801000:	51                   	push   %ecx
  801001:	50                   	push   %eax
  801002:	68 3c 24 80 00       	push   $0x80243c
  801007:	e8 1f f2 ff ff       	call   80022b <cprintf>
	*dev = 0;
  80100c:	8b 45 0c             	mov    0xc(%ebp),%eax
  80100f:	c7 00 00 00 00 00    	movl   $0x0,(%eax)
	return -E_INVAL;
  801015:	83 c4 10             	add    $0x10,%esp
  801018:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
}
  80101d:	c9                   	leave  
  80101e:	c3                   	ret    
			*dev = devtab[i];
  80101f:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801022:	89 01                	mov    %eax,(%ecx)
			return 0;
  801024:	b8 00 00 00 00       	mov    $0x0,%eax
  801029:	eb f2                	jmp    80101d <dev_lookup+0x4c>

0080102b <fd_close>:
{
  80102b:	f3 0f 1e fb          	endbr32 
  80102f:	55                   	push   %ebp
  801030:	89 e5                	mov    %esp,%ebp
  801032:	57                   	push   %edi
  801033:	56                   	push   %esi
  801034:	53                   	push   %ebx
  801035:	83 ec 24             	sub    $0x24,%esp
  801038:	8b 75 08             	mov    0x8(%ebp),%esi
  80103b:	8b 7d 0c             	mov    0xc(%ebp),%edi
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  80103e:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801041:	50                   	push   %eax
	return ((uintptr_t) fd - FDTABLE) / PGSIZE;
  801042:	8d 86 00 00 00 30    	lea    0x30000000(%esi),%eax
  801048:	c1 e8 0c             	shr    $0xc,%eax
	if ((r = fd_lookup(fd2num(fd), &fd2)) < 0
  80104b:	50                   	push   %eax
  80104c:	e8 2c ff ff ff       	call   800f7d <fd_lookup>
  801051:	89 c3                	mov    %eax,%ebx
  801053:	83 c4 10             	add    $0x10,%esp
  801056:	85 c0                	test   %eax,%eax
  801058:	78 05                	js     80105f <fd_close+0x34>
	    || fd != fd2)
  80105a:	39 75 e4             	cmp    %esi,-0x1c(%ebp)
  80105d:	74 16                	je     801075 <fd_close+0x4a>
		return (must_exist ? r : 0);
  80105f:	89 f8                	mov    %edi,%eax
  801061:	84 c0                	test   %al,%al
  801063:	b8 00 00 00 00       	mov    $0x0,%eax
  801068:	0f 44 d8             	cmove  %eax,%ebx
}
  80106b:	89 d8                	mov    %ebx,%eax
  80106d:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801070:	5b                   	pop    %ebx
  801071:	5e                   	pop    %esi
  801072:	5f                   	pop    %edi
  801073:	5d                   	pop    %ebp
  801074:	c3                   	ret    
	if ((r = dev_lookup(fd->fd_dev_id, &dev)) >= 0) {
  801075:	83 ec 08             	sub    $0x8,%esp
  801078:	8d 45 e0             	lea    -0x20(%ebp),%eax
  80107b:	50                   	push   %eax
  80107c:	ff 36                	pushl  (%esi)
  80107e:	e8 4e ff ff ff       	call   800fd1 <dev_lookup>
  801083:	89 c3                	mov    %eax,%ebx
  801085:	83 c4 10             	add    $0x10,%esp
  801088:	85 c0                	test   %eax,%eax
  80108a:	78 1a                	js     8010a6 <fd_close+0x7b>
		if (dev->dev_close)
  80108c:	8b 45 e0             	mov    -0x20(%ebp),%eax
  80108f:	8b 40 10             	mov    0x10(%eax),%eax
			r = 0;
  801092:	bb 00 00 00 00       	mov    $0x0,%ebx
		if (dev->dev_close)
  801097:	85 c0                	test   %eax,%eax
  801099:	74 0b                	je     8010a6 <fd_close+0x7b>
			r = (*dev->dev_close)(fd);
  80109b:	83 ec 0c             	sub    $0xc,%esp
  80109e:	56                   	push   %esi
  80109f:	ff d0                	call   *%eax
  8010a1:	89 c3                	mov    %eax,%ebx
  8010a3:	83 c4 10             	add    $0x10,%esp
	(void) sys_page_unmap(0, fd);
  8010a6:	83 ec 08             	sub    $0x8,%esp
  8010a9:	56                   	push   %esi
  8010aa:	6a 00                	push   $0x0
  8010ac:	e8 22 fc ff ff       	call   800cd3 <sys_page_unmap>
	return r;
  8010b1:	83 c4 10             	add    $0x10,%esp
  8010b4:	eb b5                	jmp    80106b <fd_close+0x40>

008010b6 <close>:

int
close(int fdnum)
{
  8010b6:	f3 0f 1e fb          	endbr32 
  8010ba:	55                   	push   %ebp
  8010bb:	89 e5                	mov    %esp,%ebp
  8010bd:	83 ec 20             	sub    $0x20,%esp
	struct Fd *fd;
	int r;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  8010c0:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8010c3:	50                   	push   %eax
  8010c4:	ff 75 08             	pushl  0x8(%ebp)
  8010c7:	e8 b1 fe ff ff       	call   800f7d <fd_lookup>
  8010cc:	83 c4 10             	add    $0x10,%esp
  8010cf:	85 c0                	test   %eax,%eax
  8010d1:	79 02                	jns    8010d5 <close+0x1f>
		return r;
	else
		return fd_close(fd, 1);
}
  8010d3:	c9                   	leave  
  8010d4:	c3                   	ret    
		return fd_close(fd, 1);
  8010d5:	83 ec 08             	sub    $0x8,%esp
  8010d8:	6a 01                	push   $0x1
  8010da:	ff 75 f4             	pushl  -0xc(%ebp)
  8010dd:	e8 49 ff ff ff       	call   80102b <fd_close>
  8010e2:	83 c4 10             	add    $0x10,%esp
  8010e5:	eb ec                	jmp    8010d3 <close+0x1d>

008010e7 <close_all>:

void
close_all(void)
{
  8010e7:	f3 0f 1e fb          	endbr32 
  8010eb:	55                   	push   %ebp
  8010ec:	89 e5                	mov    %esp,%ebp
  8010ee:	53                   	push   %ebx
  8010ef:	83 ec 04             	sub    $0x4,%esp
	int i;
	for (i = 0; i < MAXFD; i++)
  8010f2:	bb 00 00 00 00       	mov    $0x0,%ebx
		close(i);
  8010f7:	83 ec 0c             	sub    $0xc,%esp
  8010fa:	53                   	push   %ebx
  8010fb:	e8 b6 ff ff ff       	call   8010b6 <close>
	for (i = 0; i < MAXFD; i++)
  801100:	83 c3 01             	add    $0x1,%ebx
  801103:	83 c4 10             	add    $0x10,%esp
  801106:	83 fb 20             	cmp    $0x20,%ebx
  801109:	75 ec                	jne    8010f7 <close_all+0x10>
}
  80110b:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80110e:	c9                   	leave  
  80110f:	c3                   	ret    

00801110 <dup>:
// file and the file offset of the other.
// Closes any previously open file descriptor at 'newfdnum'.
// This is implemented using virtual memory tricks (of course!).
int
dup(int oldfdnum, int newfdnum)
{
  801110:	f3 0f 1e fb          	endbr32 
  801114:	55                   	push   %ebp
  801115:	89 e5                	mov    %esp,%ebp
  801117:	57                   	push   %edi
  801118:	56                   	push   %esi
  801119:	53                   	push   %ebx
  80111a:	83 ec 24             	sub    $0x24,%esp
	int r;
	char *ova, *nva;
	pte_t pte;
	struct Fd *oldfd, *newfd;

	if ((r = fd_lookup(oldfdnum, &oldfd)) < 0)
  80111d:	8d 45 e4             	lea    -0x1c(%ebp),%eax
  801120:	50                   	push   %eax
  801121:	ff 75 08             	pushl  0x8(%ebp)
  801124:	e8 54 fe ff ff       	call   800f7d <fd_lookup>
  801129:	89 c3                	mov    %eax,%ebx
  80112b:	83 c4 10             	add    $0x10,%esp
  80112e:	85 c0                	test   %eax,%eax
  801130:	0f 88 81 00 00 00    	js     8011b7 <dup+0xa7>
		return r;
	close(newfdnum);
  801136:	83 ec 0c             	sub    $0xc,%esp
  801139:	ff 75 0c             	pushl  0xc(%ebp)
  80113c:	e8 75 ff ff ff       	call   8010b6 <close>

	newfd = INDEX2FD(newfdnum);
  801141:	8b 75 0c             	mov    0xc(%ebp),%esi
  801144:	c1 e6 0c             	shl    $0xc,%esi
  801147:	81 ee 00 00 00 30    	sub    $0x30000000,%esi
	ova = fd2data(oldfd);
  80114d:	83 c4 04             	add    $0x4,%esp
  801150:	ff 75 e4             	pushl  -0x1c(%ebp)
  801153:	e8 b4 fd ff ff       	call   800f0c <fd2data>
  801158:	89 c3                	mov    %eax,%ebx
	nva = fd2data(newfd);
  80115a:	89 34 24             	mov    %esi,(%esp)
  80115d:	e8 aa fd ff ff       	call   800f0c <fd2data>
  801162:	83 c4 10             	add    $0x10,%esp
  801165:	89 c7                	mov    %eax,%edi

	if ((uvpd[PDX(ova)] & PTE_P) && (uvpt[PGNUM(ova)] & PTE_P))
  801167:	89 d8                	mov    %ebx,%eax
  801169:	c1 e8 16             	shr    $0x16,%eax
  80116c:	8b 04 85 00 d0 7b ef 	mov    -0x10843000(,%eax,4),%eax
  801173:	a8 01                	test   $0x1,%al
  801175:	74 11                	je     801188 <dup+0x78>
  801177:	89 d8                	mov    %ebx,%eax
  801179:	c1 e8 0c             	shr    $0xc,%eax
  80117c:	8b 14 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%edx
  801183:	f6 c2 01             	test   $0x1,%dl
  801186:	75 39                	jne    8011c1 <dup+0xb1>
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
			goto err;
	if ((r = sys_page_map(0, oldfd, 0, newfd, uvpt[PGNUM(oldfd)] & PTE_SYSCALL)) < 0)
  801188:	8b 55 e4             	mov    -0x1c(%ebp),%edx
  80118b:	89 d0                	mov    %edx,%eax
  80118d:	c1 e8 0c             	shr    $0xc,%eax
  801190:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  801197:	83 ec 0c             	sub    $0xc,%esp
  80119a:	25 07 0e 00 00       	and    $0xe07,%eax
  80119f:	50                   	push   %eax
  8011a0:	56                   	push   %esi
  8011a1:	6a 00                	push   $0x0
  8011a3:	52                   	push   %edx
  8011a4:	6a 00                	push   $0x0
  8011a6:	e8 e2 fa ff ff       	call   800c8d <sys_page_map>
  8011ab:	89 c3                	mov    %eax,%ebx
  8011ad:	83 c4 20             	add    $0x20,%esp
  8011b0:	85 c0                	test   %eax,%eax
  8011b2:	78 31                	js     8011e5 <dup+0xd5>
		goto err;

	return newfdnum;
  8011b4:	8b 5d 0c             	mov    0xc(%ebp),%ebx

err:
	sys_page_unmap(0, newfd);
	sys_page_unmap(0, nva);
	return r;
}
  8011b7:	89 d8                	mov    %ebx,%eax
  8011b9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8011bc:	5b                   	pop    %ebx
  8011bd:	5e                   	pop    %esi
  8011be:	5f                   	pop    %edi
  8011bf:	5d                   	pop    %ebp
  8011c0:	c3                   	ret    
		if ((r = sys_page_map(0, ova, 0, nva, uvpt[PGNUM(ova)] & PTE_SYSCALL)) < 0)
  8011c1:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
  8011c8:	83 ec 0c             	sub    $0xc,%esp
  8011cb:	25 07 0e 00 00       	and    $0xe07,%eax
  8011d0:	50                   	push   %eax
  8011d1:	57                   	push   %edi
  8011d2:	6a 00                	push   $0x0
  8011d4:	53                   	push   %ebx
  8011d5:	6a 00                	push   $0x0
  8011d7:	e8 b1 fa ff ff       	call   800c8d <sys_page_map>
  8011dc:	89 c3                	mov    %eax,%ebx
  8011de:	83 c4 20             	add    $0x20,%esp
  8011e1:	85 c0                	test   %eax,%eax
  8011e3:	79 a3                	jns    801188 <dup+0x78>
	sys_page_unmap(0, newfd);
  8011e5:	83 ec 08             	sub    $0x8,%esp
  8011e8:	56                   	push   %esi
  8011e9:	6a 00                	push   $0x0
  8011eb:	e8 e3 fa ff ff       	call   800cd3 <sys_page_unmap>
	sys_page_unmap(0, nva);
  8011f0:	83 c4 08             	add    $0x8,%esp
  8011f3:	57                   	push   %edi
  8011f4:	6a 00                	push   $0x0
  8011f6:	e8 d8 fa ff ff       	call   800cd3 <sys_page_unmap>
	return r;
  8011fb:	83 c4 10             	add    $0x10,%esp
  8011fe:	eb b7                	jmp    8011b7 <dup+0xa7>

00801200 <read>:

ssize_t
read(int fdnum, void *buf, size_t n)
{
  801200:	f3 0f 1e fb          	endbr32 
  801204:	55                   	push   %ebp
  801205:	89 e5                	mov    %esp,%ebp
  801207:	53                   	push   %ebx
  801208:	83 ec 1c             	sub    $0x1c,%esp
  80120b:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80120e:	8d 45 f0             	lea    -0x10(%ebp),%eax
  801211:	50                   	push   %eax
  801212:	53                   	push   %ebx
  801213:	e8 65 fd ff ff       	call   800f7d <fd_lookup>
  801218:	83 c4 10             	add    $0x10,%esp
  80121b:	85 c0                	test   %eax,%eax
  80121d:	78 3f                	js     80125e <read+0x5e>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80121f:	83 ec 08             	sub    $0x8,%esp
  801222:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801225:	50                   	push   %eax
  801226:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801229:	ff 30                	pushl  (%eax)
  80122b:	e8 a1 fd ff ff       	call   800fd1 <dev_lookup>
  801230:	83 c4 10             	add    $0x10,%esp
  801233:	85 c0                	test   %eax,%eax
  801235:	78 27                	js     80125e <read+0x5e>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_WRONLY) {
  801237:	8b 55 f0             	mov    -0x10(%ebp),%edx
  80123a:	8b 42 08             	mov    0x8(%edx),%eax
  80123d:	83 e0 03             	and    $0x3,%eax
  801240:	83 f8 01             	cmp    $0x1,%eax
  801243:	74 1e                	je     801263 <read+0x63>
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_read)
  801245:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801248:	8b 40 08             	mov    0x8(%eax),%eax
  80124b:	85 c0                	test   %eax,%eax
  80124d:	74 35                	je     801284 <read+0x84>
		return -E_NOT_SUPP;
	return (*dev->dev_read)(fd, buf, n);
  80124f:	83 ec 04             	sub    $0x4,%esp
  801252:	ff 75 10             	pushl  0x10(%ebp)
  801255:	ff 75 0c             	pushl  0xc(%ebp)
  801258:	52                   	push   %edx
  801259:	ff d0                	call   *%eax
  80125b:	83 c4 10             	add    $0x10,%esp
}
  80125e:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801261:	c9                   	leave  
  801262:	c3                   	ret    
		cprintf("[%08x] read %d -- bad mode\n", thisenv->env_id, fdnum);
  801263:	a1 04 40 80 00       	mov    0x804004,%eax
  801268:	8b 40 48             	mov    0x48(%eax),%eax
  80126b:	83 ec 04             	sub    $0x4,%esp
  80126e:	53                   	push   %ebx
  80126f:	50                   	push   %eax
  801270:	68 7d 24 80 00       	push   $0x80247d
  801275:	e8 b1 ef ff ff       	call   80022b <cprintf>
		return -E_INVAL;
  80127a:	83 c4 10             	add    $0x10,%esp
  80127d:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801282:	eb da                	jmp    80125e <read+0x5e>
		return -E_NOT_SUPP;
  801284:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801289:	eb d3                	jmp    80125e <read+0x5e>

0080128b <readn>:

ssize_t
readn(int fdnum, void *buf, size_t n)
{
  80128b:	f3 0f 1e fb          	endbr32 
  80128f:	55                   	push   %ebp
  801290:	89 e5                	mov    %esp,%ebp
  801292:	57                   	push   %edi
  801293:	56                   	push   %esi
  801294:	53                   	push   %ebx
  801295:	83 ec 0c             	sub    $0xc,%esp
  801298:	8b 7d 08             	mov    0x8(%ebp),%edi
  80129b:	8b 75 10             	mov    0x10(%ebp),%esi
	int m, tot;

	for (tot = 0; tot < n; tot += m) {
  80129e:	bb 00 00 00 00       	mov    $0x0,%ebx
  8012a3:	eb 02                	jmp    8012a7 <readn+0x1c>
  8012a5:	01 c3                	add    %eax,%ebx
  8012a7:	39 f3                	cmp    %esi,%ebx
  8012a9:	73 21                	jae    8012cc <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8012ab:	83 ec 04             	sub    $0x4,%esp
  8012ae:	89 f0                	mov    %esi,%eax
  8012b0:	29 d8                	sub    %ebx,%eax
  8012b2:	50                   	push   %eax
  8012b3:	89 d8                	mov    %ebx,%eax
  8012b5:	03 45 0c             	add    0xc(%ebp),%eax
  8012b8:	50                   	push   %eax
  8012b9:	57                   	push   %edi
  8012ba:	e8 41 ff ff ff       	call   801200 <read>
		if (m < 0)
  8012bf:	83 c4 10             	add    $0x10,%esp
  8012c2:	85 c0                	test   %eax,%eax
  8012c4:	78 04                	js     8012ca <readn+0x3f>
			return m;
		if (m == 0)
  8012c6:	75 dd                	jne    8012a5 <readn+0x1a>
  8012c8:	eb 02                	jmp    8012cc <readn+0x41>
		m = read(fdnum, (char*)buf + tot, n - tot);
  8012ca:	89 c3                	mov    %eax,%ebx
			break;
	}
	return tot;
}
  8012cc:	89 d8                	mov    %ebx,%eax
  8012ce:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8012d1:	5b                   	pop    %ebx
  8012d2:	5e                   	pop    %esi
  8012d3:	5f                   	pop    %edi
  8012d4:	5d                   	pop    %ebp
  8012d5:	c3                   	ret    

008012d6 <write>:

ssize_t
write(int fdnum, const void *buf, size_t n)
{
  8012d6:	f3 0f 1e fb          	endbr32 
  8012da:	55                   	push   %ebp
  8012db:	89 e5                	mov    %esp,%ebp
  8012dd:	53                   	push   %ebx
  8012de:	83 ec 1c             	sub    $0x1c,%esp
  8012e1:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  8012e4:	8d 45 f0             	lea    -0x10(%ebp),%eax
  8012e7:	50                   	push   %eax
  8012e8:	53                   	push   %ebx
  8012e9:	e8 8f fc ff ff       	call   800f7d <fd_lookup>
  8012ee:	83 c4 10             	add    $0x10,%esp
  8012f1:	85 c0                	test   %eax,%eax
  8012f3:	78 3a                	js     80132f <write+0x59>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8012f5:	83 ec 08             	sub    $0x8,%esp
  8012f8:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8012fb:	50                   	push   %eax
  8012fc:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8012ff:	ff 30                	pushl  (%eax)
  801301:	e8 cb fc ff ff       	call   800fd1 <dev_lookup>
  801306:	83 c4 10             	add    $0x10,%esp
  801309:	85 c0                	test   %eax,%eax
  80130b:	78 22                	js     80132f <write+0x59>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  80130d:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801310:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  801314:	74 1e                	je     801334 <write+0x5e>
		return -E_INVAL;
	}
	if (debug)
		cprintf("write %d %p %d via dev %s\n",
			fdnum, buf, n, dev->dev_name);
	if (!dev->dev_write)
  801316:	8b 55 f4             	mov    -0xc(%ebp),%edx
  801319:	8b 52 0c             	mov    0xc(%edx),%edx
  80131c:	85 d2                	test   %edx,%edx
  80131e:	74 35                	je     801355 <write+0x7f>
		return -E_NOT_SUPP;
	return (*dev->dev_write)(fd, buf, n);
  801320:	83 ec 04             	sub    $0x4,%esp
  801323:	ff 75 10             	pushl  0x10(%ebp)
  801326:	ff 75 0c             	pushl  0xc(%ebp)
  801329:	50                   	push   %eax
  80132a:	ff d2                	call   *%edx
  80132c:	83 c4 10             	add    $0x10,%esp
}
  80132f:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  801332:	c9                   	leave  
  801333:	c3                   	ret    
		cprintf("[%08x] write %d -- bad mode\n", thisenv->env_id, fdnum);
  801334:	a1 04 40 80 00       	mov    0x804004,%eax
  801339:	8b 40 48             	mov    0x48(%eax),%eax
  80133c:	83 ec 04             	sub    $0x4,%esp
  80133f:	53                   	push   %ebx
  801340:	50                   	push   %eax
  801341:	68 99 24 80 00       	push   $0x802499
  801346:	e8 e0 ee ff ff       	call   80022b <cprintf>
		return -E_INVAL;
  80134b:	83 c4 10             	add    $0x10,%esp
  80134e:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801353:	eb da                	jmp    80132f <write+0x59>
		return -E_NOT_SUPP;
  801355:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80135a:	eb d3                	jmp    80132f <write+0x59>

0080135c <seek>:

int
seek(int fdnum, off_t offset)
{
  80135c:	f3 0f 1e fb          	endbr32 
  801360:	55                   	push   %ebp
  801361:	89 e5                	mov    %esp,%ebp
  801363:	83 ec 20             	sub    $0x20,%esp
	int r;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801366:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801369:	50                   	push   %eax
  80136a:	ff 75 08             	pushl  0x8(%ebp)
  80136d:	e8 0b fc ff ff       	call   800f7d <fd_lookup>
  801372:	83 c4 10             	add    $0x10,%esp
  801375:	85 c0                	test   %eax,%eax
  801377:	78 0e                	js     801387 <seek+0x2b>
		return r;
	fd->fd_offset = offset;
  801379:	8b 55 0c             	mov    0xc(%ebp),%edx
  80137c:	8b 45 f4             	mov    -0xc(%ebp),%eax
  80137f:	89 50 04             	mov    %edx,0x4(%eax)
	return 0;
  801382:	b8 00 00 00 00       	mov    $0x0,%eax
}
  801387:	c9                   	leave  
  801388:	c3                   	ret    

00801389 <ftruncate>:

int
ftruncate(int fdnum, off_t newsize)
{
  801389:	f3 0f 1e fb          	endbr32 
  80138d:	55                   	push   %ebp
  80138e:	89 e5                	mov    %esp,%ebp
  801390:	53                   	push   %ebx
  801391:	83 ec 1c             	sub    $0x1c,%esp
  801394:	8b 5d 08             	mov    0x8(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;
	if ((r = fd_lookup(fdnum, &fd)) < 0
  801397:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80139a:	50                   	push   %eax
  80139b:	53                   	push   %ebx
  80139c:	e8 dc fb ff ff       	call   800f7d <fd_lookup>
  8013a1:	83 c4 10             	add    $0x10,%esp
  8013a4:	85 c0                	test   %eax,%eax
  8013a6:	78 37                	js     8013df <ftruncate+0x56>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  8013a8:	83 ec 08             	sub    $0x8,%esp
  8013ab:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8013ae:	50                   	push   %eax
  8013af:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013b2:	ff 30                	pushl  (%eax)
  8013b4:	e8 18 fc ff ff       	call   800fd1 <dev_lookup>
  8013b9:	83 c4 10             	add    $0x10,%esp
  8013bc:	85 c0                	test   %eax,%eax
  8013be:	78 1f                	js     8013df <ftruncate+0x56>
		return r;
	if ((fd->fd_omode & O_ACCMODE) == O_RDONLY) {
  8013c0:	8b 45 f0             	mov    -0x10(%ebp),%eax
  8013c3:	f6 40 08 03          	testb  $0x3,0x8(%eax)
  8013c7:	74 1b                	je     8013e4 <ftruncate+0x5b>
		cprintf("[%08x] ftruncate %d -- bad mode\n",
			thisenv->env_id, fdnum);
		return -E_INVAL;
	}
	if (!dev->dev_trunc)
  8013c9:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8013cc:	8b 52 18             	mov    0x18(%edx),%edx
  8013cf:	85 d2                	test   %edx,%edx
  8013d1:	74 32                	je     801405 <ftruncate+0x7c>
		return -E_NOT_SUPP;
	return (*dev->dev_trunc)(fd, newsize);
  8013d3:	83 ec 08             	sub    $0x8,%esp
  8013d6:	ff 75 0c             	pushl  0xc(%ebp)
  8013d9:	50                   	push   %eax
  8013da:	ff d2                	call   *%edx
  8013dc:	83 c4 10             	add    $0x10,%esp
}
  8013df:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8013e2:	c9                   	leave  
  8013e3:	c3                   	ret    
			thisenv->env_id, fdnum);
  8013e4:	a1 04 40 80 00       	mov    0x804004,%eax
		cprintf("[%08x] ftruncate %d -- bad mode\n",
  8013e9:	8b 40 48             	mov    0x48(%eax),%eax
  8013ec:	83 ec 04             	sub    $0x4,%esp
  8013ef:	53                   	push   %ebx
  8013f0:	50                   	push   %eax
  8013f1:	68 5c 24 80 00       	push   $0x80245c
  8013f6:	e8 30 ee ff ff       	call   80022b <cprintf>
		return -E_INVAL;
  8013fb:	83 c4 10             	add    $0x10,%esp
  8013fe:	b8 fd ff ff ff       	mov    $0xfffffffd,%eax
  801403:	eb da                	jmp    8013df <ftruncate+0x56>
		return -E_NOT_SUPP;
  801405:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  80140a:	eb d3                	jmp    8013df <ftruncate+0x56>

0080140c <fstat>:

int
fstat(int fdnum, struct Stat *stat)
{
  80140c:	f3 0f 1e fb          	endbr32 
  801410:	55                   	push   %ebp
  801411:	89 e5                	mov    %esp,%ebp
  801413:	53                   	push   %ebx
  801414:	83 ec 1c             	sub    $0x1c,%esp
  801417:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	int r;
	struct Dev *dev;
	struct Fd *fd;

	if ((r = fd_lookup(fdnum, &fd)) < 0
  80141a:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80141d:	50                   	push   %eax
  80141e:	ff 75 08             	pushl  0x8(%ebp)
  801421:	e8 57 fb ff ff       	call   800f7d <fd_lookup>
  801426:	83 c4 10             	add    $0x10,%esp
  801429:	85 c0                	test   %eax,%eax
  80142b:	78 4b                	js     801478 <fstat+0x6c>
	    || (r = dev_lookup(fd->fd_dev_id, &dev)) < 0)
  80142d:	83 ec 08             	sub    $0x8,%esp
  801430:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801433:	50                   	push   %eax
  801434:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801437:	ff 30                	pushl  (%eax)
  801439:	e8 93 fb ff ff       	call   800fd1 <dev_lookup>
  80143e:	83 c4 10             	add    $0x10,%esp
  801441:	85 c0                	test   %eax,%eax
  801443:	78 33                	js     801478 <fstat+0x6c>
		return r;
	if (!dev->dev_stat)
  801445:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801448:	83 78 14 00          	cmpl   $0x0,0x14(%eax)
  80144c:	74 2f                	je     80147d <fstat+0x71>
		return -E_NOT_SUPP;
	stat->st_name[0] = 0;
  80144e:	c6 03 00             	movb   $0x0,(%ebx)
	stat->st_size = 0;
  801451:	c7 83 80 00 00 00 00 	movl   $0x0,0x80(%ebx)
  801458:	00 00 00 
	stat->st_isdir = 0;
  80145b:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  801462:	00 00 00 
	stat->st_dev = dev;
  801465:	89 83 88 00 00 00    	mov    %eax,0x88(%ebx)
	return (*dev->dev_stat)(fd, stat);
  80146b:	83 ec 08             	sub    $0x8,%esp
  80146e:	53                   	push   %ebx
  80146f:	ff 75 f0             	pushl  -0x10(%ebp)
  801472:	ff 50 14             	call   *0x14(%eax)
  801475:	83 c4 10             	add    $0x10,%esp
}
  801478:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  80147b:	c9                   	leave  
  80147c:	c3                   	ret    
		return -E_NOT_SUPP;
  80147d:	b8 f1 ff ff ff       	mov    $0xfffffff1,%eax
  801482:	eb f4                	jmp    801478 <fstat+0x6c>

00801484 <stat>:

int
stat(const char *path, struct Stat *stat)
{
  801484:	f3 0f 1e fb          	endbr32 
  801488:	55                   	push   %ebp
  801489:	89 e5                	mov    %esp,%ebp
  80148b:	56                   	push   %esi
  80148c:	53                   	push   %ebx
	int fd, r;

	if ((fd = open(path, O_RDONLY)) < 0)
  80148d:	83 ec 08             	sub    $0x8,%esp
  801490:	6a 00                	push   $0x0
  801492:	ff 75 08             	pushl  0x8(%ebp)
  801495:	e8 fb 01 00 00       	call   801695 <open>
  80149a:	89 c3                	mov    %eax,%ebx
  80149c:	83 c4 10             	add    $0x10,%esp
  80149f:	85 c0                	test   %eax,%eax
  8014a1:	78 1b                	js     8014be <stat+0x3a>
		return fd;
	r = fstat(fd, stat);
  8014a3:	83 ec 08             	sub    $0x8,%esp
  8014a6:	ff 75 0c             	pushl  0xc(%ebp)
  8014a9:	50                   	push   %eax
  8014aa:	e8 5d ff ff ff       	call   80140c <fstat>
  8014af:	89 c6                	mov    %eax,%esi
	close(fd);
  8014b1:	89 1c 24             	mov    %ebx,(%esp)
  8014b4:	e8 fd fb ff ff       	call   8010b6 <close>
	return r;
  8014b9:	83 c4 10             	add    $0x10,%esp
  8014bc:	89 f3                	mov    %esi,%ebx
}
  8014be:	89 d8                	mov    %ebx,%eax
  8014c0:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014c3:	5b                   	pop    %ebx
  8014c4:	5e                   	pop    %esi
  8014c5:	5d                   	pop    %ebp
  8014c6:	c3                   	ret    

008014c7 <fsipc>:
// type: request code, passed as the simple integer IPC value.
// dstva: virtual address at which to receive reply page, 0 if none.
// Returns result from the file server.
static int
fsipc(unsigned type, void *dstva)
{
  8014c7:	55                   	push   %ebp
  8014c8:	89 e5                	mov    %esp,%ebp
  8014ca:	56                   	push   %esi
  8014cb:	53                   	push   %ebx
  8014cc:	89 c6                	mov    %eax,%esi
  8014ce:	89 d3                	mov    %edx,%ebx
	static envid_t fsenv;
	if (fsenv == 0)
  8014d0:	83 3d 00 40 80 00 00 	cmpl   $0x0,0x804000
  8014d7:	74 27                	je     801500 <fsipc+0x39>
	static_assert(sizeof(fsipcbuf) == PGSIZE);

	if (debug)
		cprintf("[%08x] fsipc %d %08x\n", thisenv->env_id, type, *(uint32_t *)&fsipcbuf);

	ipc_send(fsenv, type, &fsipcbuf, PTE_P | PTE_W | PTE_U);
  8014d9:	6a 07                	push   $0x7
  8014db:	68 00 50 80 00       	push   $0x805000
  8014e0:	56                   	push   %esi
  8014e1:	ff 35 00 40 80 00    	pushl  0x804000
  8014e7:	e8 d2 07 00 00       	call   801cbe <ipc_send>
	return ipc_recv(NULL, dstva, NULL);
  8014ec:	83 c4 0c             	add    $0xc,%esp
  8014ef:	6a 00                	push   $0x0
  8014f1:	53                   	push   %ebx
  8014f2:	6a 00                	push   $0x0
  8014f4:	e8 44 07 00 00       	call   801c3d <ipc_recv>
}
  8014f9:	8d 65 f8             	lea    -0x8(%ebp),%esp
  8014fc:	5b                   	pop    %ebx
  8014fd:	5e                   	pop    %esi
  8014fe:	5d                   	pop    %ebp
  8014ff:	c3                   	ret    
		fsenv = ipc_find_env(ENV_TYPE_FS);
  801500:	83 ec 0c             	sub    $0xc,%esp
  801503:	6a 01                	push   $0x1
  801505:	e8 0c 08 00 00       	call   801d16 <ipc_find_env>
  80150a:	a3 00 40 80 00       	mov    %eax,0x804000
  80150f:	83 c4 10             	add    $0x10,%esp
  801512:	eb c5                	jmp    8014d9 <fsipc+0x12>

00801514 <devfile_trunc>:
}

// Truncate or extend an open file to 'size' bytes
static int
devfile_trunc(struct Fd *fd, off_t newsize)
{
  801514:	f3 0f 1e fb          	endbr32 
  801518:	55                   	push   %ebp
  801519:	89 e5                	mov    %esp,%ebp
  80151b:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.set_size.req_fileid = fd->fd_file.id;
  80151e:	8b 45 08             	mov    0x8(%ebp),%eax
  801521:	8b 40 0c             	mov    0xc(%eax),%eax
  801524:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.set_size.req_size = newsize;
  801529:	8b 45 0c             	mov    0xc(%ebp),%eax
  80152c:	a3 04 50 80 00       	mov    %eax,0x805004
	return fsipc(FSREQ_SET_SIZE, NULL);
  801531:	ba 00 00 00 00       	mov    $0x0,%edx
  801536:	b8 02 00 00 00       	mov    $0x2,%eax
  80153b:	e8 87 ff ff ff       	call   8014c7 <fsipc>
}
  801540:	c9                   	leave  
  801541:	c3                   	ret    

00801542 <devfile_flush>:
{
  801542:	f3 0f 1e fb          	endbr32 
  801546:	55                   	push   %ebp
  801547:	89 e5                	mov    %esp,%ebp
  801549:	83 ec 08             	sub    $0x8,%esp
	fsipcbuf.flush.req_fileid = fd->fd_file.id;
  80154c:	8b 45 08             	mov    0x8(%ebp),%eax
  80154f:	8b 40 0c             	mov    0xc(%eax),%eax
  801552:	a3 00 50 80 00       	mov    %eax,0x805000
	return fsipc(FSREQ_FLUSH, NULL);
  801557:	ba 00 00 00 00       	mov    $0x0,%edx
  80155c:	b8 06 00 00 00       	mov    $0x6,%eax
  801561:	e8 61 ff ff ff       	call   8014c7 <fsipc>
}
  801566:	c9                   	leave  
  801567:	c3                   	ret    

00801568 <devfile_stat>:
{
  801568:	f3 0f 1e fb          	endbr32 
  80156c:	55                   	push   %ebp
  80156d:	89 e5                	mov    %esp,%ebp
  80156f:	53                   	push   %ebx
  801570:	83 ec 04             	sub    $0x4,%esp
  801573:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	fsipcbuf.stat.req_fileid = fd->fd_file.id;
  801576:	8b 45 08             	mov    0x8(%ebp),%eax
  801579:	8b 40 0c             	mov    0xc(%eax),%eax
  80157c:	a3 00 50 80 00       	mov    %eax,0x805000
	if ((r = fsipc(FSREQ_STAT, NULL)) < 0)
  801581:	ba 00 00 00 00       	mov    $0x0,%edx
  801586:	b8 05 00 00 00       	mov    $0x5,%eax
  80158b:	e8 37 ff ff ff       	call   8014c7 <fsipc>
  801590:	85 c0                	test   %eax,%eax
  801592:	78 2c                	js     8015c0 <devfile_stat+0x58>
	strcpy(st->st_name, fsipcbuf.statRet.ret_name);
  801594:	83 ec 08             	sub    $0x8,%esp
  801597:	68 00 50 80 00       	push   $0x805000
  80159c:	53                   	push   %ebx
  80159d:	e8 62 f2 ff ff       	call   800804 <strcpy>
	st->st_size = fsipcbuf.statRet.ret_size;
  8015a2:	a1 80 50 80 00       	mov    0x805080,%eax
  8015a7:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	st->st_isdir = fsipcbuf.statRet.ret_isdir;
  8015ad:	a1 84 50 80 00       	mov    0x805084,%eax
  8015b2:	89 83 84 00 00 00    	mov    %eax,0x84(%ebx)
	return 0;
  8015b8:	83 c4 10             	add    $0x10,%esp
  8015bb:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8015c0:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8015c3:	c9                   	leave  
  8015c4:	c3                   	ret    

008015c5 <devfile_write>:
{
  8015c5:	f3 0f 1e fb          	endbr32 
  8015c9:	55                   	push   %ebp
  8015ca:	89 e5                	mov    %esp,%ebp
  8015cc:	83 ec 0c             	sub    $0xc,%esp
  8015cf:	8b 45 10             	mov    0x10(%ebp),%eax
  8015d2:	3d f8 0f 00 00       	cmp    $0xff8,%eax
  8015d7:	ba f8 0f 00 00       	mov    $0xff8,%edx
  8015dc:	0f 47 c2             	cmova  %edx,%eax
	fsipcbuf.write.req_fileid = fd->fd_file.id;
  8015df:	8b 55 08             	mov    0x8(%ebp),%edx
  8015e2:	8b 52 0c             	mov    0xc(%edx),%edx
  8015e5:	89 15 00 50 80 00    	mov    %edx,0x805000
	fsipcbuf.write.req_n = n;
  8015eb:	a3 04 50 80 00       	mov    %eax,0x805004
	memmove(fsipcbuf.write.req_buf, buf, n);
  8015f0:	50                   	push   %eax
  8015f1:	ff 75 0c             	pushl  0xc(%ebp)
  8015f4:	68 08 50 80 00       	push   $0x805008
  8015f9:	e8 bc f3 ff ff       	call   8009ba <memmove>
	return fsipc(FSREQ_WRITE, NULL);}
  8015fe:	ba 00 00 00 00       	mov    $0x0,%edx
  801603:	b8 04 00 00 00       	mov    $0x4,%eax
  801608:	e8 ba fe ff ff       	call   8014c7 <fsipc>
  80160d:	c9                   	leave  
  80160e:	c3                   	ret    

0080160f <devfile_read>:
{
  80160f:	f3 0f 1e fb          	endbr32 
  801613:	55                   	push   %ebp
  801614:	89 e5                	mov    %esp,%ebp
  801616:	56                   	push   %esi
  801617:	53                   	push   %ebx
  801618:	8b 75 10             	mov    0x10(%ebp),%esi
	fsipcbuf.read.req_fileid = fd->fd_file.id;
  80161b:	8b 45 08             	mov    0x8(%ebp),%eax
  80161e:	8b 40 0c             	mov    0xc(%eax),%eax
  801621:	a3 00 50 80 00       	mov    %eax,0x805000
	fsipcbuf.read.req_n = n;
  801626:	89 35 04 50 80 00    	mov    %esi,0x805004
	if ((r = fsipc(FSREQ_READ, NULL)) < 0)
  80162c:	ba 00 00 00 00       	mov    $0x0,%edx
  801631:	b8 03 00 00 00       	mov    $0x3,%eax
  801636:	e8 8c fe ff ff       	call   8014c7 <fsipc>
  80163b:	89 c3                	mov    %eax,%ebx
  80163d:	85 c0                	test   %eax,%eax
  80163f:	78 1f                	js     801660 <devfile_read+0x51>
	assert(r <= n);
  801641:	39 f0                	cmp    %esi,%eax
  801643:	77 24                	ja     801669 <devfile_read+0x5a>
	assert(r <= PGSIZE);
  801645:	3d 00 10 00 00       	cmp    $0x1000,%eax
  80164a:	7f 33                	jg     80167f <devfile_read+0x70>
	memmove(buf, fsipcbuf.readRet.ret_buf, r);
  80164c:	83 ec 04             	sub    $0x4,%esp
  80164f:	50                   	push   %eax
  801650:	68 00 50 80 00       	push   $0x805000
  801655:	ff 75 0c             	pushl  0xc(%ebp)
  801658:	e8 5d f3 ff ff       	call   8009ba <memmove>
	return r;
  80165d:	83 c4 10             	add    $0x10,%esp
}
  801660:	89 d8                	mov    %ebx,%eax
  801662:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801665:	5b                   	pop    %ebx
  801666:	5e                   	pop    %esi
  801667:	5d                   	pop    %ebp
  801668:	c3                   	ret    
	assert(r <= n);
  801669:	68 c8 24 80 00       	push   $0x8024c8
  80166e:	68 cf 24 80 00       	push   $0x8024cf
  801673:	6a 7c                	push   $0x7c
  801675:	68 e4 24 80 00       	push   $0x8024e4
  80167a:	e8 c5 ea ff ff       	call   800144 <_panic>
	assert(r <= PGSIZE);
  80167f:	68 ef 24 80 00       	push   $0x8024ef
  801684:	68 cf 24 80 00       	push   $0x8024cf
  801689:	6a 7d                	push   $0x7d
  80168b:	68 e4 24 80 00       	push   $0x8024e4
  801690:	e8 af ea ff ff       	call   800144 <_panic>

00801695 <open>:
{
  801695:	f3 0f 1e fb          	endbr32 
  801699:	55                   	push   %ebp
  80169a:	89 e5                	mov    %esp,%ebp
  80169c:	56                   	push   %esi
  80169d:	53                   	push   %ebx
  80169e:	83 ec 1c             	sub    $0x1c,%esp
  8016a1:	8b 75 08             	mov    0x8(%ebp),%esi
	if (strlen(path) >= MAXPATHLEN)
  8016a4:	56                   	push   %esi
  8016a5:	e8 17 f1 ff ff       	call   8007c1 <strlen>
  8016aa:	83 c4 10             	add    $0x10,%esp
  8016ad:	3d ff 03 00 00       	cmp    $0x3ff,%eax
  8016b2:	7f 6c                	jg     801720 <open+0x8b>
	if ((r = fd_alloc(&fd)) < 0)
  8016b4:	83 ec 0c             	sub    $0xc,%esp
  8016b7:	8d 45 f4             	lea    -0xc(%ebp),%eax
  8016ba:	50                   	push   %eax
  8016bb:	e8 67 f8 ff ff       	call   800f27 <fd_alloc>
  8016c0:	89 c3                	mov    %eax,%ebx
  8016c2:	83 c4 10             	add    $0x10,%esp
  8016c5:	85 c0                	test   %eax,%eax
  8016c7:	78 3c                	js     801705 <open+0x70>
	strcpy(fsipcbuf.open.req_path, path);
  8016c9:	83 ec 08             	sub    $0x8,%esp
  8016cc:	56                   	push   %esi
  8016cd:	68 00 50 80 00       	push   $0x805000
  8016d2:	e8 2d f1 ff ff       	call   800804 <strcpy>
	fsipcbuf.open.req_omode = mode;
  8016d7:	8b 45 0c             	mov    0xc(%ebp),%eax
  8016da:	a3 00 54 80 00       	mov    %eax,0x805400
	if ((r = fsipc(FSREQ_OPEN, fd)) < 0) {
  8016df:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8016e2:	b8 01 00 00 00       	mov    $0x1,%eax
  8016e7:	e8 db fd ff ff       	call   8014c7 <fsipc>
  8016ec:	89 c3                	mov    %eax,%ebx
  8016ee:	83 c4 10             	add    $0x10,%esp
  8016f1:	85 c0                	test   %eax,%eax
  8016f3:	78 19                	js     80170e <open+0x79>
	return fd2num(fd);
  8016f5:	83 ec 0c             	sub    $0xc,%esp
  8016f8:	ff 75 f4             	pushl  -0xc(%ebp)
  8016fb:	e8 f8 f7 ff ff       	call   800ef8 <fd2num>
  801700:	89 c3                	mov    %eax,%ebx
  801702:	83 c4 10             	add    $0x10,%esp
}
  801705:	89 d8                	mov    %ebx,%eax
  801707:	8d 65 f8             	lea    -0x8(%ebp),%esp
  80170a:	5b                   	pop    %ebx
  80170b:	5e                   	pop    %esi
  80170c:	5d                   	pop    %ebp
  80170d:	c3                   	ret    
		fd_close(fd, 0);
  80170e:	83 ec 08             	sub    $0x8,%esp
  801711:	6a 00                	push   $0x0
  801713:	ff 75 f4             	pushl  -0xc(%ebp)
  801716:	e8 10 f9 ff ff       	call   80102b <fd_close>
		return r;
  80171b:	83 c4 10             	add    $0x10,%esp
  80171e:	eb e5                	jmp    801705 <open+0x70>
		return -E_BAD_PATH;
  801720:	bb f4 ff ff ff       	mov    $0xfffffff4,%ebx
  801725:	eb de                	jmp    801705 <open+0x70>

00801727 <sync>:


// Synchronize disk with buffer cache
int
sync(void)
{
  801727:	f3 0f 1e fb          	endbr32 
  80172b:	55                   	push   %ebp
  80172c:	89 e5                	mov    %esp,%ebp
  80172e:	83 ec 08             	sub    $0x8,%esp
	// Ask the file server to update the disk
	// by writing any dirty blocks in the buffer cache.

	return fsipc(FSREQ_SYNC, NULL);
  801731:	ba 00 00 00 00       	mov    $0x0,%edx
  801736:	b8 08 00 00 00       	mov    $0x8,%eax
  80173b:	e8 87 fd ff ff       	call   8014c7 <fsipc>
}
  801740:	c9                   	leave  
  801741:	c3                   	ret    

00801742 <devpipe_stat>:
	return i;
}

static int
devpipe_stat(struct Fd *fd, struct Stat *stat)
{
  801742:	f3 0f 1e fb          	endbr32 
  801746:	55                   	push   %ebp
  801747:	89 e5                	mov    %esp,%ebp
  801749:	56                   	push   %esi
  80174a:	53                   	push   %ebx
  80174b:	8b 5d 0c             	mov    0xc(%ebp),%ebx
	struct Pipe *p = (struct Pipe*) fd2data(fd);
  80174e:	83 ec 0c             	sub    $0xc,%esp
  801751:	ff 75 08             	pushl  0x8(%ebp)
  801754:	e8 b3 f7 ff ff       	call   800f0c <fd2data>
  801759:	89 c6                	mov    %eax,%esi
	strcpy(stat->st_name, "<pipe>");
  80175b:	83 c4 08             	add    $0x8,%esp
  80175e:	68 fb 24 80 00       	push   $0x8024fb
  801763:	53                   	push   %ebx
  801764:	e8 9b f0 ff ff       	call   800804 <strcpy>
	stat->st_size = p->p_wpos - p->p_rpos;
  801769:	8b 46 04             	mov    0x4(%esi),%eax
  80176c:	2b 06                	sub    (%esi),%eax
  80176e:	89 83 80 00 00 00    	mov    %eax,0x80(%ebx)
	stat->st_isdir = 0;
  801774:	c7 83 84 00 00 00 00 	movl   $0x0,0x84(%ebx)
  80177b:	00 00 00 
	stat->st_dev = &devpipe;
  80177e:	c7 83 88 00 00 00 20 	movl   $0x803020,0x88(%ebx)
  801785:	30 80 00 
	return 0;
}
  801788:	b8 00 00 00 00       	mov    $0x0,%eax
  80178d:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801790:	5b                   	pop    %ebx
  801791:	5e                   	pop    %esi
  801792:	5d                   	pop    %ebp
  801793:	c3                   	ret    

00801794 <devpipe_close>:

static int
devpipe_close(struct Fd *fd)
{
  801794:	f3 0f 1e fb          	endbr32 
  801798:	55                   	push   %ebp
  801799:	89 e5                	mov    %esp,%ebp
  80179b:	53                   	push   %ebx
  80179c:	83 ec 0c             	sub    $0xc,%esp
  80179f:	8b 5d 08             	mov    0x8(%ebp),%ebx
	(void) sys_page_unmap(0, fd);
  8017a2:	53                   	push   %ebx
  8017a3:	6a 00                	push   $0x0
  8017a5:	e8 29 f5 ff ff       	call   800cd3 <sys_page_unmap>
	return sys_page_unmap(0, fd2data(fd));
  8017aa:	89 1c 24             	mov    %ebx,(%esp)
  8017ad:	e8 5a f7 ff ff       	call   800f0c <fd2data>
  8017b2:	83 c4 08             	add    $0x8,%esp
  8017b5:	50                   	push   %eax
  8017b6:	6a 00                	push   $0x0
  8017b8:	e8 16 f5 ff ff       	call   800cd3 <sys_page_unmap>
}
  8017bd:	8b 5d fc             	mov    -0x4(%ebp),%ebx
  8017c0:	c9                   	leave  
  8017c1:	c3                   	ret    

008017c2 <_pipeisclosed>:
{
  8017c2:	55                   	push   %ebp
  8017c3:	89 e5                	mov    %esp,%ebp
  8017c5:	57                   	push   %edi
  8017c6:	56                   	push   %esi
  8017c7:	53                   	push   %ebx
  8017c8:	83 ec 1c             	sub    $0x1c,%esp
  8017cb:	89 c7                	mov    %eax,%edi
  8017cd:	89 d6                	mov    %edx,%esi
		n = thisenv->env_runs;
  8017cf:	a1 04 40 80 00       	mov    0x804004,%eax
  8017d4:	8b 58 58             	mov    0x58(%eax),%ebx
		ret = pageref(fd) == pageref(p);
  8017d7:	83 ec 0c             	sub    $0xc,%esp
  8017da:	57                   	push   %edi
  8017db:	e8 73 05 00 00       	call   801d53 <pageref>
  8017e0:	89 45 e4             	mov    %eax,-0x1c(%ebp)
  8017e3:	89 34 24             	mov    %esi,(%esp)
  8017e6:	e8 68 05 00 00       	call   801d53 <pageref>
		nn = thisenv->env_runs;
  8017eb:	8b 15 04 40 80 00    	mov    0x804004,%edx
  8017f1:	8b 4a 58             	mov    0x58(%edx),%ecx
		if (n == nn)
  8017f4:	83 c4 10             	add    $0x10,%esp
  8017f7:	39 cb                	cmp    %ecx,%ebx
  8017f9:	74 1b                	je     801816 <_pipeisclosed+0x54>
		if (n != nn && ret == 1)
  8017fb:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  8017fe:	75 cf                	jne    8017cf <_pipeisclosed+0xd>
			cprintf("pipe race avoided\n", n, thisenv->env_runs, ret);
  801800:	8b 42 58             	mov    0x58(%edx),%eax
  801803:	6a 01                	push   $0x1
  801805:	50                   	push   %eax
  801806:	53                   	push   %ebx
  801807:	68 02 25 80 00       	push   $0x802502
  80180c:	e8 1a ea ff ff       	call   80022b <cprintf>
  801811:	83 c4 10             	add    $0x10,%esp
  801814:	eb b9                	jmp    8017cf <_pipeisclosed+0xd>
		ret = pageref(fd) == pageref(p);
  801816:	39 45 e4             	cmp    %eax,-0x1c(%ebp)
  801819:	0f 94 c0             	sete   %al
  80181c:	0f b6 c0             	movzbl %al,%eax
}
  80181f:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801822:	5b                   	pop    %ebx
  801823:	5e                   	pop    %esi
  801824:	5f                   	pop    %edi
  801825:	5d                   	pop    %ebp
  801826:	c3                   	ret    

00801827 <devpipe_write>:
{
  801827:	f3 0f 1e fb          	endbr32 
  80182b:	55                   	push   %ebp
  80182c:	89 e5                	mov    %esp,%ebp
  80182e:	57                   	push   %edi
  80182f:	56                   	push   %esi
  801830:	53                   	push   %ebx
  801831:	83 ec 28             	sub    $0x28,%esp
  801834:	8b 75 08             	mov    0x8(%ebp),%esi
	p = (struct Pipe*) fd2data(fd);
  801837:	56                   	push   %esi
  801838:	e8 cf f6 ff ff       	call   800f0c <fd2data>
  80183d:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  80183f:	83 c4 10             	add    $0x10,%esp
  801842:	bf 00 00 00 00       	mov    $0x0,%edi
  801847:	3b 7d 10             	cmp    0x10(%ebp),%edi
  80184a:	74 4f                	je     80189b <devpipe_write+0x74>
		while (p->p_wpos >= p->p_rpos + sizeof(p->p_buf)) {
  80184c:	8b 43 04             	mov    0x4(%ebx),%eax
  80184f:	8b 0b                	mov    (%ebx),%ecx
  801851:	8d 51 20             	lea    0x20(%ecx),%edx
  801854:	39 d0                	cmp    %edx,%eax
  801856:	72 14                	jb     80186c <devpipe_write+0x45>
			if (_pipeisclosed(fd, p))
  801858:	89 da                	mov    %ebx,%edx
  80185a:	89 f0                	mov    %esi,%eax
  80185c:	e8 61 ff ff ff       	call   8017c2 <_pipeisclosed>
  801861:	85 c0                	test   %eax,%eax
  801863:	75 3b                	jne    8018a0 <devpipe_write+0x79>
			sys_yield();
  801865:	e8 b9 f3 ff ff       	call   800c23 <sys_yield>
  80186a:	eb e0                	jmp    80184c <devpipe_write+0x25>
		p->p_buf[p->p_wpos % PIPEBUFSIZ] = buf[i];
  80186c:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  80186f:	0f b6 0c 39          	movzbl (%ecx,%edi,1),%ecx
  801873:	88 4d e7             	mov    %cl,-0x19(%ebp)
  801876:	89 c2                	mov    %eax,%edx
  801878:	c1 fa 1f             	sar    $0x1f,%edx
  80187b:	89 d1                	mov    %edx,%ecx
  80187d:	c1 e9 1b             	shr    $0x1b,%ecx
  801880:	8d 14 08             	lea    (%eax,%ecx,1),%edx
  801883:	83 e2 1f             	and    $0x1f,%edx
  801886:	29 ca                	sub    %ecx,%edx
  801888:	0f b6 4d e7          	movzbl -0x19(%ebp),%ecx
  80188c:	88 4c 13 08          	mov    %cl,0x8(%ebx,%edx,1)
		p->p_wpos++;
  801890:	83 c0 01             	add    $0x1,%eax
  801893:	89 43 04             	mov    %eax,0x4(%ebx)
	for (i = 0; i < n; i++) {
  801896:	83 c7 01             	add    $0x1,%edi
  801899:	eb ac                	jmp    801847 <devpipe_write+0x20>
	return i;
  80189b:	8b 45 10             	mov    0x10(%ebp),%eax
  80189e:	eb 05                	jmp    8018a5 <devpipe_write+0x7e>
				return 0;
  8018a0:	b8 00 00 00 00       	mov    $0x0,%eax
}
  8018a5:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8018a8:	5b                   	pop    %ebx
  8018a9:	5e                   	pop    %esi
  8018aa:	5f                   	pop    %edi
  8018ab:	5d                   	pop    %ebp
  8018ac:	c3                   	ret    

008018ad <devpipe_read>:
{
  8018ad:	f3 0f 1e fb          	endbr32 
  8018b1:	55                   	push   %ebp
  8018b2:	89 e5                	mov    %esp,%ebp
  8018b4:	57                   	push   %edi
  8018b5:	56                   	push   %esi
  8018b6:	53                   	push   %ebx
  8018b7:	83 ec 18             	sub    $0x18,%esp
  8018ba:	8b 7d 08             	mov    0x8(%ebp),%edi
	p = (struct Pipe*)fd2data(fd);
  8018bd:	57                   	push   %edi
  8018be:	e8 49 f6 ff ff       	call   800f0c <fd2data>
  8018c3:	89 c3                	mov    %eax,%ebx
	for (i = 0; i < n; i++) {
  8018c5:	83 c4 10             	add    $0x10,%esp
  8018c8:	be 00 00 00 00       	mov    $0x0,%esi
  8018cd:	3b 75 10             	cmp    0x10(%ebp),%esi
  8018d0:	75 14                	jne    8018e6 <devpipe_read+0x39>
	return i;
  8018d2:	8b 45 10             	mov    0x10(%ebp),%eax
  8018d5:	eb 02                	jmp    8018d9 <devpipe_read+0x2c>
				return i;
  8018d7:	89 f0                	mov    %esi,%eax
}
  8018d9:	8d 65 f4             	lea    -0xc(%ebp),%esp
  8018dc:	5b                   	pop    %ebx
  8018dd:	5e                   	pop    %esi
  8018de:	5f                   	pop    %edi
  8018df:	5d                   	pop    %ebp
  8018e0:	c3                   	ret    
			sys_yield();
  8018e1:	e8 3d f3 ff ff       	call   800c23 <sys_yield>
		while (p->p_rpos == p->p_wpos) {
  8018e6:	8b 03                	mov    (%ebx),%eax
  8018e8:	3b 43 04             	cmp    0x4(%ebx),%eax
  8018eb:	75 18                	jne    801905 <devpipe_read+0x58>
			if (i > 0)
  8018ed:	85 f6                	test   %esi,%esi
  8018ef:	75 e6                	jne    8018d7 <devpipe_read+0x2a>
			if (_pipeisclosed(fd, p))
  8018f1:	89 da                	mov    %ebx,%edx
  8018f3:	89 f8                	mov    %edi,%eax
  8018f5:	e8 c8 fe ff ff       	call   8017c2 <_pipeisclosed>
  8018fa:	85 c0                	test   %eax,%eax
  8018fc:	74 e3                	je     8018e1 <devpipe_read+0x34>
				return 0;
  8018fe:	b8 00 00 00 00       	mov    $0x0,%eax
  801903:	eb d4                	jmp    8018d9 <devpipe_read+0x2c>
		buf[i] = p->p_buf[p->p_rpos % PIPEBUFSIZ];
  801905:	99                   	cltd   
  801906:	c1 ea 1b             	shr    $0x1b,%edx
  801909:	01 d0                	add    %edx,%eax
  80190b:	83 e0 1f             	and    $0x1f,%eax
  80190e:	29 d0                	sub    %edx,%eax
  801910:	0f b6 44 03 08       	movzbl 0x8(%ebx,%eax,1),%eax
  801915:	8b 4d 0c             	mov    0xc(%ebp),%ecx
  801918:	88 04 31             	mov    %al,(%ecx,%esi,1)
		p->p_rpos++;
  80191b:	83 03 01             	addl   $0x1,(%ebx)
	for (i = 0; i < n; i++) {
  80191e:	83 c6 01             	add    $0x1,%esi
  801921:	eb aa                	jmp    8018cd <devpipe_read+0x20>

00801923 <pipe>:
{
  801923:	f3 0f 1e fb          	endbr32 
  801927:	55                   	push   %ebp
  801928:	89 e5                	mov    %esp,%ebp
  80192a:	56                   	push   %esi
  80192b:	53                   	push   %ebx
  80192c:	83 ec 1c             	sub    $0x1c,%esp
	if ((r = fd_alloc(&fd0)) < 0
  80192f:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801932:	50                   	push   %eax
  801933:	e8 ef f5 ff ff       	call   800f27 <fd_alloc>
  801938:	89 c3                	mov    %eax,%ebx
  80193a:	83 c4 10             	add    $0x10,%esp
  80193d:	85 c0                	test   %eax,%eax
  80193f:	0f 88 23 01 00 00    	js     801a68 <pipe+0x145>
	    || (r = sys_page_alloc(0, fd0, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  801945:	83 ec 04             	sub    $0x4,%esp
  801948:	68 07 04 00 00       	push   $0x407
  80194d:	ff 75 f4             	pushl  -0xc(%ebp)
  801950:	6a 00                	push   $0x0
  801952:	e8 ef f2 ff ff       	call   800c46 <sys_page_alloc>
  801957:	89 c3                	mov    %eax,%ebx
  801959:	83 c4 10             	add    $0x10,%esp
  80195c:	85 c0                	test   %eax,%eax
  80195e:	0f 88 04 01 00 00    	js     801a68 <pipe+0x145>
	if ((r = fd_alloc(&fd1)) < 0
  801964:	83 ec 0c             	sub    $0xc,%esp
  801967:	8d 45 f0             	lea    -0x10(%ebp),%eax
  80196a:	50                   	push   %eax
  80196b:	e8 b7 f5 ff ff       	call   800f27 <fd_alloc>
  801970:	89 c3                	mov    %eax,%ebx
  801972:	83 c4 10             	add    $0x10,%esp
  801975:	85 c0                	test   %eax,%eax
  801977:	0f 88 db 00 00 00    	js     801a58 <pipe+0x135>
	    || (r = sys_page_alloc(0, fd1, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  80197d:	83 ec 04             	sub    $0x4,%esp
  801980:	68 07 04 00 00       	push   $0x407
  801985:	ff 75 f0             	pushl  -0x10(%ebp)
  801988:	6a 00                	push   $0x0
  80198a:	e8 b7 f2 ff ff       	call   800c46 <sys_page_alloc>
  80198f:	89 c3                	mov    %eax,%ebx
  801991:	83 c4 10             	add    $0x10,%esp
  801994:	85 c0                	test   %eax,%eax
  801996:	0f 88 bc 00 00 00    	js     801a58 <pipe+0x135>
	va = fd2data(fd0);
  80199c:	83 ec 0c             	sub    $0xc,%esp
  80199f:	ff 75 f4             	pushl  -0xc(%ebp)
  8019a2:	e8 65 f5 ff ff       	call   800f0c <fd2data>
  8019a7:	89 c6                	mov    %eax,%esi
	if ((r = sys_page_alloc(0, va, PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8019a9:	83 c4 0c             	add    $0xc,%esp
  8019ac:	68 07 04 00 00       	push   $0x407
  8019b1:	50                   	push   %eax
  8019b2:	6a 00                	push   $0x0
  8019b4:	e8 8d f2 ff ff       	call   800c46 <sys_page_alloc>
  8019b9:	89 c3                	mov    %eax,%ebx
  8019bb:	83 c4 10             	add    $0x10,%esp
  8019be:	85 c0                	test   %eax,%eax
  8019c0:	0f 88 82 00 00 00    	js     801a48 <pipe+0x125>
	if ((r = sys_page_map(0, va, 0, fd2data(fd1), PTE_P|PTE_W|PTE_U|PTE_SHARE)) < 0)
  8019c6:	83 ec 0c             	sub    $0xc,%esp
  8019c9:	ff 75 f0             	pushl  -0x10(%ebp)
  8019cc:	e8 3b f5 ff ff       	call   800f0c <fd2data>
  8019d1:	c7 04 24 07 04 00 00 	movl   $0x407,(%esp)
  8019d8:	50                   	push   %eax
  8019d9:	6a 00                	push   $0x0
  8019db:	56                   	push   %esi
  8019dc:	6a 00                	push   $0x0
  8019de:	e8 aa f2 ff ff       	call   800c8d <sys_page_map>
  8019e3:	89 c3                	mov    %eax,%ebx
  8019e5:	83 c4 20             	add    $0x20,%esp
  8019e8:	85 c0                	test   %eax,%eax
  8019ea:	78 4e                	js     801a3a <pipe+0x117>
	fd0->fd_dev_id = devpipe.dev_id;
  8019ec:	a1 20 30 80 00       	mov    0x803020,%eax
  8019f1:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8019f4:	89 02                	mov    %eax,(%edx)
	fd0->fd_omode = O_RDONLY;
  8019f6:	8b 55 f4             	mov    -0xc(%ebp),%edx
  8019f9:	c7 42 08 00 00 00 00 	movl   $0x0,0x8(%edx)
	fd1->fd_dev_id = devpipe.dev_id;
  801a00:	8b 55 f0             	mov    -0x10(%ebp),%edx
  801a03:	89 02                	mov    %eax,(%edx)
	fd1->fd_omode = O_WRONLY;
  801a05:	8b 45 f0             	mov    -0x10(%ebp),%eax
  801a08:	c7 40 08 01 00 00 00 	movl   $0x1,0x8(%eax)
	pfd[0] = fd2num(fd0);
  801a0f:	83 ec 0c             	sub    $0xc,%esp
  801a12:	ff 75 f4             	pushl  -0xc(%ebp)
  801a15:	e8 de f4 ff ff       	call   800ef8 <fd2num>
  801a1a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a1d:	89 01                	mov    %eax,(%ecx)
	pfd[1] = fd2num(fd1);
  801a1f:	83 c4 04             	add    $0x4,%esp
  801a22:	ff 75 f0             	pushl  -0x10(%ebp)
  801a25:	e8 ce f4 ff ff       	call   800ef8 <fd2num>
  801a2a:	8b 4d 08             	mov    0x8(%ebp),%ecx
  801a2d:	89 41 04             	mov    %eax,0x4(%ecx)
	return 0;
  801a30:	83 c4 10             	add    $0x10,%esp
  801a33:	bb 00 00 00 00       	mov    $0x0,%ebx
  801a38:	eb 2e                	jmp    801a68 <pipe+0x145>
	sys_page_unmap(0, va);
  801a3a:	83 ec 08             	sub    $0x8,%esp
  801a3d:	56                   	push   %esi
  801a3e:	6a 00                	push   $0x0
  801a40:	e8 8e f2 ff ff       	call   800cd3 <sys_page_unmap>
  801a45:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd1);
  801a48:	83 ec 08             	sub    $0x8,%esp
  801a4b:	ff 75 f0             	pushl  -0x10(%ebp)
  801a4e:	6a 00                	push   $0x0
  801a50:	e8 7e f2 ff ff       	call   800cd3 <sys_page_unmap>
  801a55:	83 c4 10             	add    $0x10,%esp
	sys_page_unmap(0, fd0);
  801a58:	83 ec 08             	sub    $0x8,%esp
  801a5b:	ff 75 f4             	pushl  -0xc(%ebp)
  801a5e:	6a 00                	push   $0x0
  801a60:	e8 6e f2 ff ff       	call   800cd3 <sys_page_unmap>
  801a65:	83 c4 10             	add    $0x10,%esp
}
  801a68:	89 d8                	mov    %ebx,%eax
  801a6a:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801a6d:	5b                   	pop    %ebx
  801a6e:	5e                   	pop    %esi
  801a6f:	5d                   	pop    %ebp
  801a70:	c3                   	ret    

00801a71 <pipeisclosed>:
{
  801a71:	f3 0f 1e fb          	endbr32 
  801a75:	55                   	push   %ebp
  801a76:	89 e5                	mov    %esp,%ebp
  801a78:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801a7b:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801a7e:	50                   	push   %eax
  801a7f:	ff 75 08             	pushl  0x8(%ebp)
  801a82:	e8 f6 f4 ff ff       	call   800f7d <fd_lookup>
  801a87:	83 c4 10             	add    $0x10,%esp
  801a8a:	85 c0                	test   %eax,%eax
  801a8c:	78 18                	js     801aa6 <pipeisclosed+0x35>
	p = (struct Pipe*) fd2data(fd);
  801a8e:	83 ec 0c             	sub    $0xc,%esp
  801a91:	ff 75 f4             	pushl  -0xc(%ebp)
  801a94:	e8 73 f4 ff ff       	call   800f0c <fd2data>
  801a99:	89 c2                	mov    %eax,%edx
	return _pipeisclosed(fd, p);
  801a9b:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801a9e:	e8 1f fd ff ff       	call   8017c2 <_pipeisclosed>
  801aa3:	83 c4 10             	add    $0x10,%esp
}
  801aa6:	c9                   	leave  
  801aa7:	c3                   	ret    

00801aa8 <devcons_close>:
	return tot;
}

static int
devcons_close(struct Fd *fd)
{
  801aa8:	f3 0f 1e fb          	endbr32 
	USED(fd);

	return 0;
}
  801aac:	b8 00 00 00 00       	mov    $0x0,%eax
  801ab1:	c3                   	ret    

00801ab2 <devcons_stat>:

static int
devcons_stat(struct Fd *fd, struct Stat *stat)
{
  801ab2:	f3 0f 1e fb          	endbr32 
  801ab6:	55                   	push   %ebp
  801ab7:	89 e5                	mov    %esp,%ebp
  801ab9:	83 ec 10             	sub    $0x10,%esp
	strcpy(stat->st_name, "<cons>");
  801abc:	68 1a 25 80 00       	push   $0x80251a
  801ac1:	ff 75 0c             	pushl  0xc(%ebp)
  801ac4:	e8 3b ed ff ff       	call   800804 <strcpy>
	return 0;
}
  801ac9:	b8 00 00 00 00       	mov    $0x0,%eax
  801ace:	c9                   	leave  
  801acf:	c3                   	ret    

00801ad0 <devcons_write>:
{
  801ad0:	f3 0f 1e fb          	endbr32 
  801ad4:	55                   	push   %ebp
  801ad5:	89 e5                	mov    %esp,%ebp
  801ad7:	57                   	push   %edi
  801ad8:	56                   	push   %esi
  801ad9:	53                   	push   %ebx
  801ada:	81 ec 8c 00 00 00    	sub    $0x8c,%esp
	for (tot = 0; tot < n; tot += m) {
  801ae0:	be 00 00 00 00       	mov    $0x0,%esi
		memmove(buf, (char*)vbuf + tot, m);
  801ae5:	8d bd 68 ff ff ff    	lea    -0x98(%ebp),%edi
	for (tot = 0; tot < n; tot += m) {
  801aeb:	3b 75 10             	cmp    0x10(%ebp),%esi
  801aee:	73 31                	jae    801b21 <devcons_write+0x51>
		m = n - tot;
  801af0:	8b 5d 10             	mov    0x10(%ebp),%ebx
  801af3:	29 f3                	sub    %esi,%ebx
  801af5:	83 fb 7f             	cmp    $0x7f,%ebx
  801af8:	b8 7f 00 00 00       	mov    $0x7f,%eax
  801afd:	0f 47 d8             	cmova  %eax,%ebx
		memmove(buf, (char*)vbuf + tot, m);
  801b00:	83 ec 04             	sub    $0x4,%esp
  801b03:	53                   	push   %ebx
  801b04:	89 f0                	mov    %esi,%eax
  801b06:	03 45 0c             	add    0xc(%ebp),%eax
  801b09:	50                   	push   %eax
  801b0a:	57                   	push   %edi
  801b0b:	e8 aa ee ff ff       	call   8009ba <memmove>
		sys_cputs(buf, m);
  801b10:	83 c4 08             	add    $0x8,%esp
  801b13:	53                   	push   %ebx
  801b14:	57                   	push   %edi
  801b15:	e8 5c f0 ff ff       	call   800b76 <sys_cputs>
	for (tot = 0; tot < n; tot += m) {
  801b1a:	01 de                	add    %ebx,%esi
  801b1c:	83 c4 10             	add    $0x10,%esp
  801b1f:	eb ca                	jmp    801aeb <devcons_write+0x1b>
}
  801b21:	89 f0                	mov    %esi,%eax
  801b23:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801b26:	5b                   	pop    %ebx
  801b27:	5e                   	pop    %esi
  801b28:	5f                   	pop    %edi
  801b29:	5d                   	pop    %ebp
  801b2a:	c3                   	ret    

00801b2b <devcons_read>:
{
  801b2b:	f3 0f 1e fb          	endbr32 
  801b2f:	55                   	push   %ebp
  801b30:	89 e5                	mov    %esp,%ebp
  801b32:	83 ec 08             	sub    $0x8,%esp
  801b35:	b8 00 00 00 00       	mov    $0x0,%eax
	if (n == 0)
  801b3a:	83 7d 10 00          	cmpl   $0x0,0x10(%ebp)
  801b3e:	74 21                	je     801b61 <devcons_read+0x36>
	while ((c = sys_cgetc()) == 0)
  801b40:	e8 53 f0 ff ff       	call   800b98 <sys_cgetc>
  801b45:	85 c0                	test   %eax,%eax
  801b47:	75 07                	jne    801b50 <devcons_read+0x25>
		sys_yield();
  801b49:	e8 d5 f0 ff ff       	call   800c23 <sys_yield>
  801b4e:	eb f0                	jmp    801b40 <devcons_read+0x15>
	if (c < 0)
  801b50:	78 0f                	js     801b61 <devcons_read+0x36>
	if (c == 0x04)	// ctl-d is eof
  801b52:	83 f8 04             	cmp    $0x4,%eax
  801b55:	74 0c                	je     801b63 <devcons_read+0x38>
	*(char*)vbuf = c;
  801b57:	8b 55 0c             	mov    0xc(%ebp),%edx
  801b5a:	88 02                	mov    %al,(%edx)
	return 1;
  801b5c:	b8 01 00 00 00       	mov    $0x1,%eax
}
  801b61:	c9                   	leave  
  801b62:	c3                   	ret    
		return 0;
  801b63:	b8 00 00 00 00       	mov    $0x0,%eax
  801b68:	eb f7                	jmp    801b61 <devcons_read+0x36>

00801b6a <cputchar>:
{
  801b6a:	f3 0f 1e fb          	endbr32 
  801b6e:	55                   	push   %ebp
  801b6f:	89 e5                	mov    %esp,%ebp
  801b71:	83 ec 20             	sub    $0x20,%esp
	char c = ch;
  801b74:	8b 45 08             	mov    0x8(%ebp),%eax
  801b77:	88 45 f7             	mov    %al,-0x9(%ebp)
	sys_cputs(&c, 1);
  801b7a:	6a 01                	push   $0x1
  801b7c:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801b7f:	50                   	push   %eax
  801b80:	e8 f1 ef ff ff       	call   800b76 <sys_cputs>
}
  801b85:	83 c4 10             	add    $0x10,%esp
  801b88:	c9                   	leave  
  801b89:	c3                   	ret    

00801b8a <getchar>:
{
  801b8a:	f3 0f 1e fb          	endbr32 
  801b8e:	55                   	push   %ebp
  801b8f:	89 e5                	mov    %esp,%ebp
  801b91:	83 ec 1c             	sub    $0x1c,%esp
	r = read(0, &c, 1);
  801b94:	6a 01                	push   $0x1
  801b96:	8d 45 f7             	lea    -0x9(%ebp),%eax
  801b99:	50                   	push   %eax
  801b9a:	6a 00                	push   $0x0
  801b9c:	e8 5f f6 ff ff       	call   801200 <read>
	if (r < 0)
  801ba1:	83 c4 10             	add    $0x10,%esp
  801ba4:	85 c0                	test   %eax,%eax
  801ba6:	78 06                	js     801bae <getchar+0x24>
	if (r < 1)
  801ba8:	74 06                	je     801bb0 <getchar+0x26>
	return c;
  801baa:	0f b6 45 f7          	movzbl -0x9(%ebp),%eax
}
  801bae:	c9                   	leave  
  801baf:	c3                   	ret    
		return -E_EOF;
  801bb0:	b8 f8 ff ff ff       	mov    $0xfffffff8,%eax
  801bb5:	eb f7                	jmp    801bae <getchar+0x24>

00801bb7 <iscons>:
{
  801bb7:	f3 0f 1e fb          	endbr32 
  801bbb:	55                   	push   %ebp
  801bbc:	89 e5                	mov    %esp,%ebp
  801bbe:	83 ec 20             	sub    $0x20,%esp
	if ((r = fd_lookup(fdnum, &fd)) < 0)
  801bc1:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801bc4:	50                   	push   %eax
  801bc5:	ff 75 08             	pushl  0x8(%ebp)
  801bc8:	e8 b0 f3 ff ff       	call   800f7d <fd_lookup>
  801bcd:	83 c4 10             	add    $0x10,%esp
  801bd0:	85 c0                	test   %eax,%eax
  801bd2:	78 11                	js     801be5 <iscons+0x2e>
	return fd->fd_dev_id == devcons.dev_id;
  801bd4:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801bd7:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801bdd:	39 10                	cmp    %edx,(%eax)
  801bdf:	0f 94 c0             	sete   %al
  801be2:	0f b6 c0             	movzbl %al,%eax
}
  801be5:	c9                   	leave  
  801be6:	c3                   	ret    

00801be7 <opencons>:
{
  801be7:	f3 0f 1e fb          	endbr32 
  801beb:	55                   	push   %ebp
  801bec:	89 e5                	mov    %esp,%ebp
  801bee:	83 ec 24             	sub    $0x24,%esp
	if ((r = fd_alloc(&fd)) < 0)
  801bf1:	8d 45 f4             	lea    -0xc(%ebp),%eax
  801bf4:	50                   	push   %eax
  801bf5:	e8 2d f3 ff ff       	call   800f27 <fd_alloc>
  801bfa:	83 c4 10             	add    $0x10,%esp
  801bfd:	85 c0                	test   %eax,%eax
  801bff:	78 3a                	js     801c3b <opencons+0x54>
	if ((r = sys_page_alloc(0, fd, PTE_P|PTE_U|PTE_W|PTE_SHARE)) < 0)
  801c01:	83 ec 04             	sub    $0x4,%esp
  801c04:	68 07 04 00 00       	push   $0x407
  801c09:	ff 75 f4             	pushl  -0xc(%ebp)
  801c0c:	6a 00                	push   $0x0
  801c0e:	e8 33 f0 ff ff       	call   800c46 <sys_page_alloc>
  801c13:	83 c4 10             	add    $0x10,%esp
  801c16:	85 c0                	test   %eax,%eax
  801c18:	78 21                	js     801c3b <opencons+0x54>
	fd->fd_dev_id = devcons.dev_id;
  801c1a:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801c1d:	8b 15 3c 30 80 00    	mov    0x80303c,%edx
  801c23:	89 10                	mov    %edx,(%eax)
	fd->fd_omode = O_RDWR;
  801c25:	8b 45 f4             	mov    -0xc(%ebp),%eax
  801c28:	c7 40 08 02 00 00 00 	movl   $0x2,0x8(%eax)
	return fd2num(fd);
  801c2f:	83 ec 0c             	sub    $0xc,%esp
  801c32:	50                   	push   %eax
  801c33:	e8 c0 f2 ff ff       	call   800ef8 <fd2num>
  801c38:	83 c4 10             	add    $0x10,%esp
}
  801c3b:	c9                   	leave  
  801c3c:	c3                   	ret    

00801c3d <ipc_recv>:
//   If 'pg' is null, pass sys_ipc_recv a value that it will understand
//   as meaning "no page".  (Zero is not the right value, since that's
//   a perfectly valid place to map a page.)
int32_t
ipc_recv(envid_t *from_env_store, void *pg, int *perm_store)
{
  801c3d:	f3 0f 1e fb          	endbr32 
  801c41:	55                   	push   %ebp
  801c42:	89 e5                	mov    %esp,%ebp
  801c44:	56                   	push   %esi
  801c45:	53                   	push   %ebx
  801c46:	8b 75 08             	mov    0x8(%ebp),%esi
  801c49:	8b 45 0c             	mov    0xc(%ebp),%eax
  801c4c:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	int error;
	if(!pg)pg = (void *)UTOP; // 如果设置为UTOP，这个值其实可以比UTOP大，设置为这个值认为pg无效了，不会进行页面传递【共享页面的设置】，而是只进行值value的传递。
  801c4f:	85 c0                	test   %eax,%eax
  801c51:	ba 00 00 c0 ee       	mov    $0xeec00000,%edx
  801c56:	0f 44 c2             	cmove  %edx,%eax
	if((error = sys_ipc_recv(pg)) < 0){
  801c59:	83 ec 0c             	sub    $0xc,%esp
  801c5c:	50                   	push   %eax
  801c5d:	e8 b0 f1 ff ff       	call   800e12 <sys_ipc_recv>
  801c62:	83 c4 10             	add    $0x10,%esp
  801c65:	85 c0                	test   %eax,%eax
  801c67:	78 3f                	js     801ca8 <ipc_recv+0x6b>
		if(from_env_store)*from_env_store = 0;
		if(perm_store)*perm_store = 0;
		return error;
	}

	thisenv = &envs[ENVX(sys_getenvid())]; // for lab4's challenge sfork().
  801c69:	e8 92 ef ff ff       	call   800c00 <sys_getenvid>
  801c6e:	25 ff 03 00 00       	and    $0x3ff,%eax
  801c73:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801c76:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801c7c:	89 15 04 40 80 00    	mov    %edx,0x804004

	if(from_env_store)*from_env_store = thisenv->env_ipc_from;
  801c82:	85 f6                	test   %esi,%esi
  801c84:	74 05                	je     801c8b <ipc_recv+0x4e>
  801c86:	8b 42 74             	mov    0x74(%edx),%eax
  801c89:	89 06                	mov    %eax,(%esi)
	if(perm_store)*perm_store = thisenv->env_ipc_perm;
  801c8b:	85 db                	test   %ebx,%ebx
  801c8d:	74 0a                	je     801c99 <ipc_recv+0x5c>
  801c8f:	a1 04 40 80 00       	mov    0x804004,%eax
  801c94:	8b 40 78             	mov    0x78(%eax),%eax
  801c97:	89 03                	mov    %eax,(%ebx)
	return thisenv->env_ipc_value;
  801c99:	a1 04 40 80 00       	mov    0x804004,%eax
  801c9e:	8b 40 70             	mov    0x70(%eax),%eax
}
  801ca1:	8d 65 f8             	lea    -0x8(%ebp),%esp
  801ca4:	5b                   	pop    %ebx
  801ca5:	5e                   	pop    %esi
  801ca6:	5d                   	pop    %ebp
  801ca7:	c3                   	ret    
		if(from_env_store)*from_env_store = 0;
  801ca8:	85 f6                	test   %esi,%esi
  801caa:	74 06                	je     801cb2 <ipc_recv+0x75>
  801cac:	c7 06 00 00 00 00    	movl   $0x0,(%esi)
		if(perm_store)*perm_store = 0;
  801cb2:	85 db                	test   %ebx,%ebx
  801cb4:	74 eb                	je     801ca1 <ipc_recv+0x64>
  801cb6:	c7 03 00 00 00 00    	movl   $0x0,(%ebx)
  801cbc:	eb e3                	jmp    801ca1 <ipc_recv+0x64>

00801cbe <ipc_send>:
//   Use sys_yield() to be CPU-friendly.
//   If 'pg' is null, pass sys_ipc_try_send a value that it will understand
//   as meaning "no page".  (Zero is not the right value.)
void
ipc_send(envid_t to_env, uint32_t val, void *pg, int perm)
{
  801cbe:	f3 0f 1e fb          	endbr32 
  801cc2:	55                   	push   %ebp
  801cc3:	89 e5                	mov    %esp,%ebp
  801cc5:	57                   	push   %edi
  801cc6:	56                   	push   %esi
  801cc7:	53                   	push   %ebx
  801cc8:	83 ec 0c             	sub    $0xc,%esp
  801ccb:	8b 7d 08             	mov    0x8(%ebp),%edi
  801cce:	8b 75 0c             	mov    0xc(%ebp),%esi
  801cd1:	8b 5d 10             	mov    0x10(%ebp),%ebx
	// LAB 4: Your code here.
	if(!pg)pg = (void *)UTOP; // 不会进行页面共享，只会sending message。
  801cd4:	85 db                	test   %ebx,%ebx
  801cd6:	b8 00 00 c0 ee       	mov    $0xeec00000,%eax
  801cdb:	0f 44 d8             	cmove  %eax,%ebx
	int error;
	// Keep trying until it succeeds.
	while((error = sys_ipc_try_send(to_env, val, pg, perm)) < 0){
  801cde:	ff 75 14             	pushl  0x14(%ebp)
  801ce1:	53                   	push   %ebx
  801ce2:	56                   	push   %esi
  801ce3:	57                   	push   %edi
  801ce4:	e8 02 f1 ff ff       	call   800deb <sys_ipc_try_send>
  801ce9:	83 c4 10             	add    $0x10,%esp
  801cec:	85 c0                	test   %eax,%eax
  801cee:	79 1e                	jns    801d0e <ipc_send+0x50>
        //如果error是没有接收者，那么就会继续尝试send
		if(error != -E_IPC_NOT_RECV){
  801cf0:	83 f8 f9             	cmp    $0xfffffff9,%eax
  801cf3:	75 07                	jne    801cfc <ipc_send+0x3e>
			panic("sys_ipc_try_send:%e", error);
		}
        //但是不是一味的占用cpu，而是尝试一次就释放CPU，等待再次被调度，才会重新send，寻找receiver。
		sys_yield(); // To be CPU-friendly.
  801cf5:	e8 29 ef ff ff       	call   800c23 <sys_yield>
  801cfa:	eb e2                	jmp    801cde <ipc_send+0x20>
			panic("sys_ipc_try_send:%e", error);
  801cfc:	50                   	push   %eax
  801cfd:	68 26 25 80 00       	push   $0x802526
  801d02:	6a 3b                	push   $0x3b
  801d04:	68 3a 25 80 00       	push   $0x80253a
  801d09:	e8 36 e4 ff ff       	call   800144 <_panic>
	}
}
  801d0e:	8d 65 f4             	lea    -0xc(%ebp),%esp
  801d11:	5b                   	pop    %ebx
  801d12:	5e                   	pop    %esi
  801d13:	5f                   	pop    %edi
  801d14:	5d                   	pop    %ebp
  801d15:	c3                   	ret    

00801d16 <ipc_find_env>:
// Find the first environment of the given type.  We'll use this to
// find special environments.
// Returns 0 if no such environment exists.
envid_t
ipc_find_env(enum EnvType type)
{
  801d16:	f3 0f 1e fb          	endbr32 
  801d1a:	55                   	push   %ebp
  801d1b:	89 e5                	mov    %esp,%ebp
  801d1d:	8b 4d 08             	mov    0x8(%ebp),%ecx
	int i;
	for (i = 0; i < NENV; i++)
  801d20:	b8 00 00 00 00       	mov    $0x0,%eax
		if (envs[i].env_type == type)
  801d25:	6b d0 7c             	imul   $0x7c,%eax,%edx
  801d28:	81 c2 00 00 c0 ee    	add    $0xeec00000,%edx
  801d2e:	8b 52 50             	mov    0x50(%edx),%edx
  801d31:	39 ca                	cmp    %ecx,%edx
  801d33:	74 11                	je     801d46 <ipc_find_env+0x30>
	for (i = 0; i < NENV; i++)
  801d35:	83 c0 01             	add    $0x1,%eax
  801d38:	3d 00 04 00 00       	cmp    $0x400,%eax
  801d3d:	75 e6                	jne    801d25 <ipc_find_env+0xf>
			return envs[i].env_id;
	return 0;
  801d3f:	b8 00 00 00 00       	mov    $0x0,%eax
  801d44:	eb 0b                	jmp    801d51 <ipc_find_env+0x3b>
			return envs[i].env_id;
  801d46:	6b c0 7c             	imul   $0x7c,%eax,%eax
  801d49:	05 00 00 c0 ee       	add    $0xeec00000,%eax
  801d4e:	8b 40 48             	mov    0x48(%eax),%eax
}
  801d51:	5d                   	pop    %ebp
  801d52:	c3                   	ret    

00801d53 <pageref>:
#include <inc/lib.h>

int
pageref(void *v)
{
  801d53:	f3 0f 1e fb          	endbr32 
  801d57:	55                   	push   %ebp
  801d58:	89 e5                	mov    %esp,%ebp
  801d5a:	8b 45 08             	mov    0x8(%ebp),%eax
	pte_t pte;

	if (!(uvpd[PDX(v)] & PTE_P))
  801d5d:	89 c2                	mov    %eax,%edx
  801d5f:	c1 ea 16             	shr    $0x16,%edx
  801d62:	8b 0c 95 00 d0 7b ef 	mov    -0x10843000(,%edx,4),%ecx
		return 0;
  801d69:	ba 00 00 00 00       	mov    $0x0,%edx
	if (!(uvpd[PDX(v)] & PTE_P))
  801d6e:	f6 c1 01             	test   $0x1,%cl
  801d71:	74 1c                	je     801d8f <pageref+0x3c>
	pte = uvpt[PGNUM(v)];
  801d73:	c1 e8 0c             	shr    $0xc,%eax
  801d76:	8b 04 85 00 00 40 ef 	mov    -0x10c00000(,%eax,4),%eax
	if (!(pte & PTE_P))
  801d7d:	a8 01                	test   $0x1,%al
  801d7f:	74 0e                	je     801d8f <pageref+0x3c>
		return 0;
	return pages[PGNUM(pte)].pp_ref;
  801d81:	c1 e8 0c             	shr    $0xc,%eax
  801d84:	0f b7 14 c5 04 00 00 	movzwl -0x10fffffc(,%eax,8),%edx
  801d8b:	ef 
  801d8c:	0f b7 d2             	movzwl %dx,%edx
}
  801d8f:	89 d0                	mov    %edx,%eax
  801d91:	5d                   	pop    %ebp
  801d92:	c3                   	ret    
  801d93:	66 90                	xchg   %ax,%ax
  801d95:	66 90                	xchg   %ax,%ax
  801d97:	66 90                	xchg   %ax,%ax
  801d99:	66 90                	xchg   %ax,%ax
  801d9b:	66 90                	xchg   %ax,%ax
  801d9d:	66 90                	xchg   %ax,%ax
  801d9f:	90                   	nop

00801da0 <__udivdi3>:
  801da0:	f3 0f 1e fb          	endbr32 
  801da4:	55                   	push   %ebp
  801da5:	57                   	push   %edi
  801da6:	56                   	push   %esi
  801da7:	53                   	push   %ebx
  801da8:	83 ec 1c             	sub    $0x1c,%esp
  801dab:	8b 54 24 3c          	mov    0x3c(%esp),%edx
  801daf:	8b 6c 24 30          	mov    0x30(%esp),%ebp
  801db3:	8b 74 24 34          	mov    0x34(%esp),%esi
  801db7:	8b 5c 24 38          	mov    0x38(%esp),%ebx
  801dbb:	85 d2                	test   %edx,%edx
  801dbd:	75 19                	jne    801dd8 <__udivdi3+0x38>
  801dbf:	39 f3                	cmp    %esi,%ebx
  801dc1:	76 4d                	jbe    801e10 <__udivdi3+0x70>
  801dc3:	31 ff                	xor    %edi,%edi
  801dc5:	89 e8                	mov    %ebp,%eax
  801dc7:	89 f2                	mov    %esi,%edx
  801dc9:	f7 f3                	div    %ebx
  801dcb:	89 fa                	mov    %edi,%edx
  801dcd:	83 c4 1c             	add    $0x1c,%esp
  801dd0:	5b                   	pop    %ebx
  801dd1:	5e                   	pop    %esi
  801dd2:	5f                   	pop    %edi
  801dd3:	5d                   	pop    %ebp
  801dd4:	c3                   	ret    
  801dd5:	8d 76 00             	lea    0x0(%esi),%esi
  801dd8:	39 f2                	cmp    %esi,%edx
  801dda:	76 14                	jbe    801df0 <__udivdi3+0x50>
  801ddc:	31 ff                	xor    %edi,%edi
  801dde:	31 c0                	xor    %eax,%eax
  801de0:	89 fa                	mov    %edi,%edx
  801de2:	83 c4 1c             	add    $0x1c,%esp
  801de5:	5b                   	pop    %ebx
  801de6:	5e                   	pop    %esi
  801de7:	5f                   	pop    %edi
  801de8:	5d                   	pop    %ebp
  801de9:	c3                   	ret    
  801dea:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801df0:	0f bd fa             	bsr    %edx,%edi
  801df3:	83 f7 1f             	xor    $0x1f,%edi
  801df6:	75 48                	jne    801e40 <__udivdi3+0xa0>
  801df8:	39 f2                	cmp    %esi,%edx
  801dfa:	72 06                	jb     801e02 <__udivdi3+0x62>
  801dfc:	31 c0                	xor    %eax,%eax
  801dfe:	39 eb                	cmp    %ebp,%ebx
  801e00:	77 de                	ja     801de0 <__udivdi3+0x40>
  801e02:	b8 01 00 00 00       	mov    $0x1,%eax
  801e07:	eb d7                	jmp    801de0 <__udivdi3+0x40>
  801e09:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e10:	89 d9                	mov    %ebx,%ecx
  801e12:	85 db                	test   %ebx,%ebx
  801e14:	75 0b                	jne    801e21 <__udivdi3+0x81>
  801e16:	b8 01 00 00 00       	mov    $0x1,%eax
  801e1b:	31 d2                	xor    %edx,%edx
  801e1d:	f7 f3                	div    %ebx
  801e1f:	89 c1                	mov    %eax,%ecx
  801e21:	31 d2                	xor    %edx,%edx
  801e23:	89 f0                	mov    %esi,%eax
  801e25:	f7 f1                	div    %ecx
  801e27:	89 c6                	mov    %eax,%esi
  801e29:	89 e8                	mov    %ebp,%eax
  801e2b:	89 f7                	mov    %esi,%edi
  801e2d:	f7 f1                	div    %ecx
  801e2f:	89 fa                	mov    %edi,%edx
  801e31:	83 c4 1c             	add    $0x1c,%esp
  801e34:	5b                   	pop    %ebx
  801e35:	5e                   	pop    %esi
  801e36:	5f                   	pop    %edi
  801e37:	5d                   	pop    %ebp
  801e38:	c3                   	ret    
  801e39:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801e40:	89 f9                	mov    %edi,%ecx
  801e42:	b8 20 00 00 00       	mov    $0x20,%eax
  801e47:	29 f8                	sub    %edi,%eax
  801e49:	d3 e2                	shl    %cl,%edx
  801e4b:	89 54 24 08          	mov    %edx,0x8(%esp)
  801e4f:	89 c1                	mov    %eax,%ecx
  801e51:	89 da                	mov    %ebx,%edx
  801e53:	d3 ea                	shr    %cl,%edx
  801e55:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801e59:	09 d1                	or     %edx,%ecx
  801e5b:	89 f2                	mov    %esi,%edx
  801e5d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801e61:	89 f9                	mov    %edi,%ecx
  801e63:	d3 e3                	shl    %cl,%ebx
  801e65:	89 c1                	mov    %eax,%ecx
  801e67:	d3 ea                	shr    %cl,%edx
  801e69:	89 f9                	mov    %edi,%ecx
  801e6b:	89 5c 24 0c          	mov    %ebx,0xc(%esp)
  801e6f:	89 eb                	mov    %ebp,%ebx
  801e71:	d3 e6                	shl    %cl,%esi
  801e73:	89 c1                	mov    %eax,%ecx
  801e75:	d3 eb                	shr    %cl,%ebx
  801e77:	09 de                	or     %ebx,%esi
  801e79:	89 f0                	mov    %esi,%eax
  801e7b:	f7 74 24 08          	divl   0x8(%esp)
  801e7f:	89 d6                	mov    %edx,%esi
  801e81:	89 c3                	mov    %eax,%ebx
  801e83:	f7 64 24 0c          	mull   0xc(%esp)
  801e87:	39 d6                	cmp    %edx,%esi
  801e89:	72 15                	jb     801ea0 <__udivdi3+0x100>
  801e8b:	89 f9                	mov    %edi,%ecx
  801e8d:	d3 e5                	shl    %cl,%ebp
  801e8f:	39 c5                	cmp    %eax,%ebp
  801e91:	73 04                	jae    801e97 <__udivdi3+0xf7>
  801e93:	39 d6                	cmp    %edx,%esi
  801e95:	74 09                	je     801ea0 <__udivdi3+0x100>
  801e97:	89 d8                	mov    %ebx,%eax
  801e99:	31 ff                	xor    %edi,%edi
  801e9b:	e9 40 ff ff ff       	jmp    801de0 <__udivdi3+0x40>
  801ea0:	8d 43 ff             	lea    -0x1(%ebx),%eax
  801ea3:	31 ff                	xor    %edi,%edi
  801ea5:	e9 36 ff ff ff       	jmp    801de0 <__udivdi3+0x40>
  801eaa:	66 90                	xchg   %ax,%ax
  801eac:	66 90                	xchg   %ax,%ax
  801eae:	66 90                	xchg   %ax,%ax

00801eb0 <__umoddi3>:
  801eb0:	f3 0f 1e fb          	endbr32 
  801eb4:	55                   	push   %ebp
  801eb5:	57                   	push   %edi
  801eb6:	56                   	push   %esi
  801eb7:	53                   	push   %ebx
  801eb8:	83 ec 1c             	sub    $0x1c,%esp
  801ebb:	8b 44 24 3c          	mov    0x3c(%esp),%eax
  801ebf:	8b 74 24 30          	mov    0x30(%esp),%esi
  801ec3:	8b 5c 24 34          	mov    0x34(%esp),%ebx
  801ec7:	8b 7c 24 38          	mov    0x38(%esp),%edi
  801ecb:	85 c0                	test   %eax,%eax
  801ecd:	75 19                	jne    801ee8 <__umoddi3+0x38>
  801ecf:	39 df                	cmp    %ebx,%edi
  801ed1:	76 5d                	jbe    801f30 <__umoddi3+0x80>
  801ed3:	89 f0                	mov    %esi,%eax
  801ed5:	89 da                	mov    %ebx,%edx
  801ed7:	f7 f7                	div    %edi
  801ed9:	89 d0                	mov    %edx,%eax
  801edb:	31 d2                	xor    %edx,%edx
  801edd:	83 c4 1c             	add    $0x1c,%esp
  801ee0:	5b                   	pop    %ebx
  801ee1:	5e                   	pop    %esi
  801ee2:	5f                   	pop    %edi
  801ee3:	5d                   	pop    %ebp
  801ee4:	c3                   	ret    
  801ee5:	8d 76 00             	lea    0x0(%esi),%esi
  801ee8:	89 f2                	mov    %esi,%edx
  801eea:	39 d8                	cmp    %ebx,%eax
  801eec:	76 12                	jbe    801f00 <__umoddi3+0x50>
  801eee:	89 f0                	mov    %esi,%eax
  801ef0:	89 da                	mov    %ebx,%edx
  801ef2:	83 c4 1c             	add    $0x1c,%esp
  801ef5:	5b                   	pop    %ebx
  801ef6:	5e                   	pop    %esi
  801ef7:	5f                   	pop    %edi
  801ef8:	5d                   	pop    %ebp
  801ef9:	c3                   	ret    
  801efa:	8d b6 00 00 00 00    	lea    0x0(%esi),%esi
  801f00:	0f bd e8             	bsr    %eax,%ebp
  801f03:	83 f5 1f             	xor    $0x1f,%ebp
  801f06:	75 50                	jne    801f58 <__umoddi3+0xa8>
  801f08:	39 d8                	cmp    %ebx,%eax
  801f0a:	0f 82 e0 00 00 00    	jb     801ff0 <__umoddi3+0x140>
  801f10:	89 d9                	mov    %ebx,%ecx
  801f12:	39 f7                	cmp    %esi,%edi
  801f14:	0f 86 d6 00 00 00    	jbe    801ff0 <__umoddi3+0x140>
  801f1a:	89 d0                	mov    %edx,%eax
  801f1c:	89 ca                	mov    %ecx,%edx
  801f1e:	83 c4 1c             	add    $0x1c,%esp
  801f21:	5b                   	pop    %ebx
  801f22:	5e                   	pop    %esi
  801f23:	5f                   	pop    %edi
  801f24:	5d                   	pop    %ebp
  801f25:	c3                   	ret    
  801f26:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f2d:	8d 76 00             	lea    0x0(%esi),%esi
  801f30:	89 fd                	mov    %edi,%ebp
  801f32:	85 ff                	test   %edi,%edi
  801f34:	75 0b                	jne    801f41 <__umoddi3+0x91>
  801f36:	b8 01 00 00 00       	mov    $0x1,%eax
  801f3b:	31 d2                	xor    %edx,%edx
  801f3d:	f7 f7                	div    %edi
  801f3f:	89 c5                	mov    %eax,%ebp
  801f41:	89 d8                	mov    %ebx,%eax
  801f43:	31 d2                	xor    %edx,%edx
  801f45:	f7 f5                	div    %ebp
  801f47:	89 f0                	mov    %esi,%eax
  801f49:	f7 f5                	div    %ebp
  801f4b:	89 d0                	mov    %edx,%eax
  801f4d:	31 d2                	xor    %edx,%edx
  801f4f:	eb 8c                	jmp    801edd <__umoddi3+0x2d>
  801f51:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801f58:	89 e9                	mov    %ebp,%ecx
  801f5a:	ba 20 00 00 00       	mov    $0x20,%edx
  801f5f:	29 ea                	sub    %ebp,%edx
  801f61:	d3 e0                	shl    %cl,%eax
  801f63:	89 44 24 08          	mov    %eax,0x8(%esp)
  801f67:	89 d1                	mov    %edx,%ecx
  801f69:	89 f8                	mov    %edi,%eax
  801f6b:	d3 e8                	shr    %cl,%eax
  801f6d:	8b 4c 24 08          	mov    0x8(%esp),%ecx
  801f71:	89 54 24 04          	mov    %edx,0x4(%esp)
  801f75:	8b 54 24 04          	mov    0x4(%esp),%edx
  801f79:	09 c1                	or     %eax,%ecx
  801f7b:	89 d8                	mov    %ebx,%eax
  801f7d:	89 4c 24 08          	mov    %ecx,0x8(%esp)
  801f81:	89 e9                	mov    %ebp,%ecx
  801f83:	d3 e7                	shl    %cl,%edi
  801f85:	89 d1                	mov    %edx,%ecx
  801f87:	d3 e8                	shr    %cl,%eax
  801f89:	89 e9                	mov    %ebp,%ecx
  801f8b:	89 7c 24 0c          	mov    %edi,0xc(%esp)
  801f8f:	d3 e3                	shl    %cl,%ebx
  801f91:	89 c7                	mov    %eax,%edi
  801f93:	89 d1                	mov    %edx,%ecx
  801f95:	89 f0                	mov    %esi,%eax
  801f97:	d3 e8                	shr    %cl,%eax
  801f99:	89 e9                	mov    %ebp,%ecx
  801f9b:	89 fa                	mov    %edi,%edx
  801f9d:	d3 e6                	shl    %cl,%esi
  801f9f:	09 d8                	or     %ebx,%eax
  801fa1:	f7 74 24 08          	divl   0x8(%esp)
  801fa5:	89 d1                	mov    %edx,%ecx
  801fa7:	89 f3                	mov    %esi,%ebx
  801fa9:	f7 64 24 0c          	mull   0xc(%esp)
  801fad:	89 c6                	mov    %eax,%esi
  801faf:	89 d7                	mov    %edx,%edi
  801fb1:	39 d1                	cmp    %edx,%ecx
  801fb3:	72 06                	jb     801fbb <__umoddi3+0x10b>
  801fb5:	75 10                	jne    801fc7 <__umoddi3+0x117>
  801fb7:	39 c3                	cmp    %eax,%ebx
  801fb9:	73 0c                	jae    801fc7 <__umoddi3+0x117>
  801fbb:	2b 44 24 0c          	sub    0xc(%esp),%eax
  801fbf:	1b 54 24 08          	sbb    0x8(%esp),%edx
  801fc3:	89 d7                	mov    %edx,%edi
  801fc5:	89 c6                	mov    %eax,%esi
  801fc7:	89 ca                	mov    %ecx,%edx
  801fc9:	0f b6 4c 24 04       	movzbl 0x4(%esp),%ecx
  801fce:	29 f3                	sub    %esi,%ebx
  801fd0:	19 fa                	sbb    %edi,%edx
  801fd2:	89 d0                	mov    %edx,%eax
  801fd4:	d3 e0                	shl    %cl,%eax
  801fd6:	89 e9                	mov    %ebp,%ecx
  801fd8:	d3 eb                	shr    %cl,%ebx
  801fda:	d3 ea                	shr    %cl,%edx
  801fdc:	09 d8                	or     %ebx,%eax
  801fde:	83 c4 1c             	add    $0x1c,%esp
  801fe1:	5b                   	pop    %ebx
  801fe2:	5e                   	pop    %esi
  801fe3:	5f                   	pop    %edi
  801fe4:	5d                   	pop    %ebp
  801fe5:	c3                   	ret    
  801fe6:	8d b4 26 00 00 00 00 	lea    0x0(%esi,%eiz,1),%esi
  801fed:	8d 76 00             	lea    0x0(%esi),%esi
  801ff0:	29 fe                	sub    %edi,%esi
  801ff2:	19 c3                	sbb    %eax,%ebx
  801ff4:	89 f2                	mov    %esi,%edx
  801ff6:	89 d9                	mov    %ebx,%ecx
  801ff8:	e9 1d ff ff ff       	jmp    801f1a <__umoddi3+0x6a>
